This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)canDrawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale { | |
NSURL* fileURL = [(HeatMap*)self.overlay localUrlForStyle:@"classic" withMapRect:mapRect andZoomScale:zoomScale]; | |
if([[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) | |
return YES; | |
[(HeatMap*)self.overlay fetchFileForStyle:@"classic" withMapRect:mapRect zoomScale:zoomScale completion:^{ | |
[self setNeedsDisplayInMapRect:mapRect zoomScale:zoomScale]; | |
}]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGFloat pageWidth = scrollView.frame.size.width; | |
int page = floor((scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testTabsGetNotified | |
{ | |
[[mockController stub] requestSessionId]; | |
[[mockController stub] endVisit]; | |
id mockVideoController = [OCMockObject partialMockForObject:playgroundController.videoController]; | |
id mockArtController = [OCMockObject partialMockForObject:playgroundController.artController]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testBottomGradientGetsAdded | |
{ | |
[[mockController expect] addBottomGradient:viewController.basicFeaturesHeader]; | |
[[mockController expect] addBottomGradient:viewController.premiumFeaturesHeader]; | |
[viewController viewDidLoad]; | |
[mockController verify]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)purchaseBook:(ZOBook*)aBook | |
{ | |
NSDictionary * params = @{ @"book_id" : aBook.serverId }; | |
ZORequestExecutor * request = [ [ZORequestExecutor sharedFactory ] executorWithDelegate: self | |
resource: [NSString stringWithFormat: @"%@/%@/purchase", self.resourcePath, aBook.serverId] | |
params: nil ]; | |
[ request post ]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)zoodlesPurchaseDidFinish | |
{ | |
[self.cellBeingPurchased hideProcessingPayment]; | |
self.midTransaction = NO; | |
[self.booksFetchController performFetch:nil]; | |
[self.tableView reloadData]; | |
[[ZOStore sharedStore] setDelegate:nil]; | |
// Invalidate the ZOReading's so a newly purchased book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) invalidateInContext:(NSManagedObjectContext *)context | |
{ | |
NSFetchRequest* request = [[NSFetchRequest alloc]initWithEntityName:kZODownloadName]; | |
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"targetEntity == %@", self.modelClassString]; | |
request.predicate = predicate; | |
NSArray* downloads = [context executeFetchRequest:request error:nil]; | |
for (ZODownload* download in downloads) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.view.frame = CGRectMake(0, 0, DeviceSpecificSetting(480, 568), 320); | |
- OR - | |
NSInteger width = DeviceSpecificSetting(480, 568); | |
self.view.frame = CGRectMake(0, 0, width, 320); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)requestBooks | |
{ | |
[self.activityIndicator startAnimating]; | |
self.booksResource = [[ZOBookResource alloc] initWithKidId:nil | |
delegate:self | |
finished:@selector(requestBooksFinished) | |
failed:nil]; | |
[self.booksResource index]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- ( void ) updateWithDictionary: ( NSDictionary * ) dict { | |
if( !dict ) { return; } | |
NSString * dateString = [ dict objectForKey: @"created_at" ]; | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; | |
[ dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; | |
NSDate* date = [dateFormatter dateFromString:dateString]; | |
self.createdAt = date; | |
self.serverId = [ dict objectForKey: @"id" ]; |
OlderNewer