Merge pull request #2190 from fridtjof/fixes/available-annotations

Small iOS version checking clean ups
This commit is contained in:
manuroe 2019-01-21 09:53:20 +01:00 committed by GitHub
commit ef35c9e3ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 16 deletions

View file

@ -6,6 +6,7 @@ Improvements:
* Use modern literals and array/dictionary syntax where possible (PR #2160).
* Add SwiftGen pod in order to generate Swift constants for assets (#2177).
* RoomVC: `Redact` has been renamed to `Remove` to match riot/web (#2134).
* Clean up iOS version checking (#2190).
Bug fix:
* Use white scroll bar on dark themes (#2158).

View file

@ -892,7 +892,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
{
self.isOffline = YES;
}
return [self showAlertWithTitle:title message:msg];
}
@ -1077,20 +1077,18 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
if (!isPushRegistered)
{
NSMutableSet* notificationCategories = [NSMutableSet set];
if ([[UIMutableUserNotificationAction class] instancesRespondToSelector:@selector(behavior)])
{
UIMutableUserNotificationAction* quickReply = [[UIMutableUserNotificationAction alloc] init];
quickReply.title = NSLocalizedStringFromTable(@"room_message_short_placeholder", @"Vector", nil);
quickReply.identifier = @"inline-reply";
quickReply.activationMode = UIUserNotificationActivationModeBackground;
quickReply.authenticationRequired = true;
quickReply.behavior = UIUserNotificationActionBehaviorTextInput;
UIMutableUserNotificationCategory* quickReplyCategory = [[UIMutableUserNotificationCategory alloc] init];
quickReplyCategory.identifier = @"QUICK_REPLY";
[quickReplyCategory setActions:@[quickReply] forContext:UIUserNotificationActionContextDefault];
[notificationCategories addObject:quickReplyCategory];
}
UIMutableUserNotificationAction* quickReply = [[UIMutableUserNotificationAction alloc] init];
quickReply.title = NSLocalizedStringFromTable(@"room_message_short_placeholder", @"Vector", nil);
quickReply.identifier = @"inline-reply";
quickReply.activationMode = UIUserNotificationActivationModeBackground;
quickReply.authenticationRequired = true;
quickReply.behavior = UIUserNotificationActionBehaviorTextInput;
UIMutableUserNotificationCategory* quickReplyCategory = [[UIMutableUserNotificationCategory alloc] init];
quickReplyCategory.identifier = @"QUICK_REPLY";
[quickReplyCategory setActions:@[quickReply] forContext:UIUserNotificationActionContextDefault];
[notificationCategories addObject:quickReplyCategory];
// Registration on iOS 8 and later
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound |UIUserNotificationTypeAlert) categories:notificationCategories];

View file

@ -817,7 +817,7 @@
self.tabBar.items[index].badgeValue = badgeValue;
if ([UITabBarItem instancesRespondToSelector:@selector(setBadgeColor:)])
if (@available(iOS 10, *))
{
self.tabBar.items[index].badgeColor = badgeColor;
}
@ -834,7 +834,7 @@
{
self.tabBar.items[index].badgeValue = mark;
if ([UITabBarItem instancesRespondToSelector:@selector(setBadgeColor:)])
if (@available(iOS 10, *))
{
self.tabBar.items[index].badgeColor = badgeColor;
}