Avoid deprecation warning from Apple
Apparently Apple invent half-assed language extensions like @available and then dont implement them properly
This commit is contained in:
parent
ae6318cb5a
commit
889f2fce6d
1 changed files with 2 additions and 2 deletions
|
|
@ -230,8 +230,8 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|||
willPresentNotification:(UNNotification *)notification
|
||||
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
||||
UNNotificationPresentationOptions options = UNNotificationPresentationOptionSound;
|
||||
if(@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
|
||||
else options |= UNNotificationPresentationOptionAlert;
|
||||
if (@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
|
||||
else options |= (1 << 2); // UNNotificationPresentationOptionAlert avoid deprecated warning
|
||||
completionHandler(options);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue