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
NSArray *albums = @[[Album albumWithName:@"Random Access Memories" price:9.99f], | |
[Album albumWithName:@"Clarity" price:6.99f], | |
[Album albumWithName:@"Weekend in America" price:7.99f], | |
[Album albumWithName:@"Weekend in America" price:7.90f], | |
[Album albumWithName:@"Bangarang EP" price:2.99f]]; | |
// Reversing an Array | |
__unused NSArray *reversed = albums.reverseObjectEnumerator.allObjects; | |
// PREDICATES |
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
tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag; | |
Or to dismiss when touch | |
tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; |
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)animateRefreshButton:(BOOL)willAnimate{ | |
if (willAnimate) { | |
[self.btnRefresh setEnabled:NO]; | |
CASpringAnimation* springRotation = [CASpringAnimation animationWithKeyPath:@"transform.rotation.z"]; | |
springRotation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 /* full rotation*/]; | |
springRotation.duration = 2.0f; | |
springRotation.cumulative = YES; | |
springRotation.repeatCount = INT_MAX; | |
springRotation.damping = 8; |
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
#define NSLocalizedFormatString(fmt, ...) [NSString stringWithFormat:NSLocalizedString(fmt, nil), __VA_ARGS__] |
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
+ (NSInteger)getDaysBetween:(NSDate*)dateBegin | |
withDate:(NSDate*)dateEnd{ | |
NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit | |
fromDate:dateBegin | |
toDate:dateEnd | |
options:0]; | |
return [components day]; | |
} |
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.edgesForExtendedLayout = UIRectEdgeNone; |
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)didMoveToParentViewController:(UIViewController *)parent | |
{ | |
// parent is nil if this view controller was removed | |
} |
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
[aeiou] - matches exactly one lowercase vowel | |
[^aeiou] - matches a character that ISN'T a lowercase vowel (negated character class) | |
^[aeiou] - matches a lowercase vowel anchored at the beginning of the line | |
[^^] - matches a character that isn't a caret/'^' | |
^[^^] - matches a character that isn't a caret at the beginning of line | |
^[^.]. - matches anything but a literal period, followed by "any" character, at the beginning of line | |
[a-z] - matches exactly one character within the range of 'a' to 'z' (i.e. all lowercase letters) | |
[az-] - matches either an 'a', a 'z', or a '-' (literal dash) | |
[.*]* - matches a contiguous sequence (possibly empty) of dots and asterisks | |
[aeiou]{3} - matches 3 consecutive lowercase vowels (all not necessarily the same vowel) |
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
#pragma mark - UICollectionView Datasource | |
// 1 | |
- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section { | |
return 1; | |
} | |
// 2 | |
- (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView { | |
return 1; | |
} |
NewerOlder