mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #2190 from fridtjof/fixes/available-annotations
Small iOS version checking clean ups
This commit is contained in:
commit
ef35c9e3ed
3 changed files with 15 additions and 16 deletions
|
@ -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).
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue