Skip to content

Commit

Permalink
Remove deprication warrnings for iOS 8
Browse files Browse the repository at this point in the history
iOS 8 depricated `interfaceOrientation` property of `UIViewController`.

`CTAssetsViewController` was using `interfaceOrientation` and documentation
suggests using `[[UIApplication sharedApplication] statusBarOrientation]`
instead, so I've replaced it.

Definitions on `NSCalendarUnit` enum were renamed, and old names were
depricated. I've replaced old names with new.
  • Loading branch information
indiche committed Feb 23, 2015
1 parent 9327c22 commit 2ebd5d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CTAssetsPickerController/CTAssetsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ @implementation CTAssetsViewController

- (id)init
{
UICollectionViewFlowLayout *layout = [self collectionViewFlowLayoutOfOrientation:self.interfaceOrientation];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
UICollectionViewFlowLayout *layout = [self collectionViewFlowLayoutOfOrientation:interfaceOrientation];

if (self = [super initWithCollectionViewLayout:layout])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ - (NSDateComponents *)dateComponetsWithTimeInterval:(NSTimeInterval)timeInterval
NSDate *date2 = [[NSDate alloc] initWithTimeInterval:timeInterval sinceDate:date1];

unsigned int unitFlags =
NSSecondCalendarUnit | NSMinuteCalendarUnit | NSHourCalendarUnit |
NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit;
NSCalendarUnitSecond | NSCalendarUnitMinute | NSCalendarUnitHour |
NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear;

return [calendar components:unitFlags
fromDate:date1
Expand Down

0 comments on commit 2ebd5d5

Please sign in to comment.