diff --git a/Signal/src/environment/iOSVersions.h b/Signal/src/environment/iOSVersions.h index f03ccdb49..c63fb5880 100644 --- a/Signal/src/environment/iOSVersions.h +++ b/Signal/src/environment/iOSVersions.h @@ -76,6 +76,14 @@ #define _iOS_8_0 NSFoundationVersionNumber_iOS_8_0 #endif +#ifndef NSFoundationVersionNumber_iOS_8_0_2 +#define NSFoundationVersionNumber_iOS_8_0_2 1140.110000 //extracted with NSLog(@"%f", NSFoundationVersionNumber) +#endif + +#ifdef NSFoundationVersionNumber_iOS_8_0_2 +#define _iOS_8_0_2 NSFoundationVersionNumber_iOS_8_0_2 +#endif + /** Add a Singelton implementation to the .m File diff --git a/Signal/src/textsecure/Messages/TSMessagesManager.m b/Signal/src/textsecure/Messages/TSMessagesManager.m index 5950b5013..a0bbe125e 100644 --- a/Signal/src/textsecure/Messages/TSMessagesManager.m +++ b/Signal/src/textsecure/Messages/TSMessagesManager.m @@ -294,7 +294,7 @@ return [NSString stringWithFormat:@"%@ : %@", name, message.body]; break; default: - DDLogWarn(@"Unexpected notification type %ld", setting); + DDLogWarn(@"Unexpected notification type %u", setting); break; } } diff --git a/Signal/src/view controllers/NotificationPreviewViewController.m b/Signal/src/view controllers/NotificationPreviewViewController.m index 018c68055..3e7e40967 100644 --- a/Signal/src/view controllers/NotificationPreviewViewController.m +++ b/Signal/src/view controllers/NotificationPreviewViewController.m @@ -18,32 +18,36 @@ @implementation NotificationPreviewViewController -- (void)viewDidLoad { +- (void)viewDidLoad +{ [super viewDidLoad]; self.navigationItem.title = @"Notification Style"; - self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero]; + self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; self.clearsSelectionOnViewWillAppear = NO; } -- (void)didReceiveMemoryWarning { +- (void)didReceiveMemoryWarning +{ [super didReceiveMemoryWarning]; } --(void)viewWillAppear:(BOOL)animated +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSInteger currentSetting = (NSInteger)[Environment.preferences notificationPreviewType]; - _defaultSelectedIndexPath = [NSIndexPath indexPathForRow:0 inSection:currentSetting+1]; + _defaultSelectedIndexPath = [NSIndexPath indexPathForRow:0 inSection:currentSetting + 1]; [self selectRowAtIndexPath:_defaultSelectedIndexPath]; } #pragma mark - Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ return 4; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ return 1; } @@ -51,48 +55,46 @@ { UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view; [header.textLabel setTextColor:[UIColor blackColor]]; - [header.textLabel setFont:[UIFont ows_thinFontWithSize:14.0f]]; - + if (SYSTEM_VERSION_GREATER_THAN(_iOS_8_0_2)) { + [header.textLabel setFont:[UIFont ows_thinFontWithSize:14.0f]]; + } } --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - - if (_defaultSelectedIndexPath != nil && ![_defaultSelectedIndexPath isEqual:indexPath]) - { + if (_defaultSelectedIndexPath != nil && ![_defaultSelectedIndexPath isEqual:indexPath]) { [self deselectRowAtIndexPath:_defaultSelectedIndexPath]; _defaultSelectedIndexPath = nil; } - - UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:indexPath]; + + UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryCheckmark; switch (indexPath.section) { case 1: [Environment.preferences setNotificationPreviewType:NotificationNoNameNoPreview]; break; - + case 2: [Environment.preferences setNotificationPreviewType:NotificationNameNoPreview]; break; - + case 3: [Environment.preferences setNotificationPreviewType:NotificationNamePreview]; break; - + default: break; } - } - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:indexPath]; + UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryNone; } --(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { return 120.0f; @@ -103,16 +105,14 @@ #pragma mark - Cell selection proxy --(void)selectRowAtIndexPath:(NSIndexPath*)indexPath +- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath { [self.tableView.delegate tableView:self.tableView didSelectRowAtIndexPath:indexPath]; } --(void)deselectRowAtIndexPath:(NSIndexPath*)indexPath +- (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath { [self.tableView.delegate tableView:self.tableView didDeselectRowAtIndexPath:indexPath]; } - - @end