Skip to content

Commit

Permalink
Fix deprecated constants, ignore deprecation warning on interfaceOrie…
Browse files Browse the repository at this point in the history
…ntation
  • Loading branch information
frankus committed Jan 15, 2016
1 parent f835096 commit adf9e54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ - (void)viewDidLoad {
}

- (void)viewDidLayoutSubviews {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
[self resizeForOrientation:self.interfaceOrientation duration:0];
#pragma clang diagnostic pop
}

- (void)viewWillDisappear:(BOOL)animated {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ - (void)viewDidLoad {
self.dateFormatter.dateFormat = [NSDateFormatter dateFormatFromTemplate:@"MMMMdyyyy" options:0 locale:[NSLocale currentLocale]];
self.dataSource.dateFormatter.dateFormat = self.dateFormatter.dateFormat; // Used to determine if date changed between messages

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
UIInterfaceOrientation interfaceOrientation = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad ? UIInterfaceOrientationPortrait : self.interfaceOrientation;
#pragma clang diagnostic pop
self.greetingView.orientation = interfaceOrientation;
self.profileView.orientation = interfaceOrientation;
self.messageInputView.orientation = interfaceOrientation;
Expand Down Expand Up @@ -182,7 +185,7 @@ - (void)viewDidLoad {
self.messageInputView.attachButton.accessibilityHint = ATLocalizedString(@"Attaches a photo or screenshot", @"Accessibility hint for 'attach'");

if (self.interaction.profileRequested) {
UIBarButtonItem *profileButtonItem = [[UIBarButtonItem alloc] initWithImage:[ATBackend imageNamed:@"at_account"] landscapeImagePhone:[ATBackend imageNamed:@"at_account"] style:UIBarButtonItemStyleBordered target:self action:@selector(showWho:)];
UIBarButtonItem *profileButtonItem = [[UIBarButtonItem alloc] initWithImage:[ATBackend imageNamed:@"at_account"] landscapeImagePhone:[ATBackend imageNamed:@"at_account"] style:UIBarButtonItemStylePlain target:self action:@selector(showWho:)];
profileButtonItem.accessibilityLabel = ATLocalizedString(@"Profile", @"Accessibility label for 'edit profile' button");
profileButtonItem.accessibilityHint = ATLocalizedString(@"Displays name and email editor.", @"Accessibility hint for 'edit profile' button");
self.navigationItem.leftBarButtonItem = profileButtonItem;
Expand Down
6 changes: 3 additions & 3 deletions ApptentiveConnect/source/Misc/ATUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,12 @@ + (NSDate *)dateFromISO8601String:(NSString *)string {
NSDate *result = nil;

NSDate *now = [NSDate date];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
calendar.firstWeekday = 2;
calendar.timeZone = [NSTimeZone defaultTimeZone];

NSDateComponents *components = [[NSDateComponents alloc] init];
NSDateComponents *nowComponents = [calendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:now];
NSDateComponents *nowComponents = [calendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:now];
components.calendar = calendar;

NSScanner *scanner = [[NSScanner alloc] initWithString:string];
Expand Down Expand Up @@ -979,7 +979,7 @@ + (void)setupDateFormatters {
if (dateFormatter == nil) {
dateFormatter = [[NSDateFormatter alloc] init];
NSLocale *enUSLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
[dateFormatter setLocale:enUSLocale];
[dateFormatter setCalendar:calendar];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
Expand Down

0 comments on commit adf9e54

Please sign in to comment.