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)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
cell.backgroundColor = [UIColor clearColor]; | |
} |
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
for (NSString *familyName in [UIFont familyNames]) { | |
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { | |
NSLog(@"%@", fontName); | |
} | |
} |
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)observeKeyboard | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillChangeFrameNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; | |
} | |
- (void)stopObservingKeyboard | |
{ | |
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; |
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
// .h file | |
@interface LessonManager : NSObject | |
@property (strong, nonatomic) NSString * imageTitle; | |
+ (instancetype) sharedInstance; | |
@end |
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
/* | |
File: UIImage+ImageEffects.h | |
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. | |
Version: 1.0 | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of | |
this Apple software constitutes acceptance of these terms. If you do | |
not agree with these terms, please do not use, install, modify or |
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
/* | |
File: UIImage+ImageEffects.m | |
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. | |
Version: 1.0 | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of | |
this Apple software constitutes acceptance of these terms. If you do | |
not agree with these terms, please do not use, install, modify or |
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.myConstraint.constant = 1234; | |
[UIView animateWithDuration:0.3 animations:^{ | |
[self.someview layoutIfNeeded]; | |
}]; |
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
// delete all placeholder meal logs older than a certain date | |
NSPredicate *oldPlaceholderPredicate = [NSPredicate predicateWithFormat:@"(isPlaceholderMealLog = TRUE) AND (eatenOn < %@)", twoDaysAgoAtMidnight]; | |
[MealLogManaged MR_deleteAllMatchingPredicate:oldPlaceholderPredicate inContext:context]; |
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
YapDatabaseViewGroupingWithObjectBlock groupingBlock = ^NSString *(NSString *collection, NSString *key, id object) { | |
if (![object isKindOfClass:[MealLogRemote class]]) { | |
return nil; | |
} | |
return "all"; // we only need one section/group in this case | |
}; | |
YapDatabaseViewSortingWithObjectBlock sortingBlock = ^NSComparisonResult (NSString *group, NSString *collection1, NSString *key1, MealLogRemote *obj1, | |
NSString *collection2, NSString *key2, MealLogRemote *obj2){ | |
// we don't need sorting but this using a sorting for a view is mandatory, lets sort it by date |
OlderNewer