This file contains hidden or 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
NSDate *fromDate = ...; | |
NSDate *toDate = ...; | |
NSCalendar *gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; | |
NSInteger daysDiff = [gregorian components:NSCalendarUnitDay fromDate:fromDate toDate:toDate options:0].day; | |
NSMutableArray<NSDate *> *array = [NSMutableArray arrayWithObject:fromDate]; | |
for (int i = 1; i <= daysDiff; i++) { | |
NSDate *date = [gregorian dateByAddingUnit:NSCalendarUnitDay value:daysDiff toDate:toDate options:0]; | |
if (date) [array addObject:date]; | |
} | |
NSArray<NSDate *> *dates = array.copy; |
This file contains hidden or 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
NSDictionary *launchImageNames = @{ | |
@"320x480" : @"[email protected]", | |
@"320x568" : @"[email protected]", | |
@"375x667" : @"[email protected]", | |
@"414x736" : @"[email protected]" | |
}; | |
NSString *aspect = [NSString stringWithFormat:@"%@x%@",@([UIScreen mainScreen].bounds.size.width),@([UIScreen mainScreen].bounds.size.height)]; | |
UIImage *launchImage = [UIImage imageNamed:launchImageNames[aspect]]; |
This file contains hidden or 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
[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"de", @"en", @"fr", nil] forKey:@"AppleLanguages"]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; //to make the change immediate |