'UNUserNotificationCenter' is only available on iOS 10.0 or newer
'UNUserNotificationCenter' is only available on iOS 10.0 or newer
- Subject: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer
- From: Steve Christensen <email@hidden>
- Date: Fri, 12 May 2017 10:30:01 -0700
Xcode 8.3.1, iOS SDK 10.3, iOS deployment target 9.0, Obj-C.
I am including an import of <UserNotifications/UserNotifications.h> in the target's prefix file. I am seeing a bunch of warnings in UNUserNotificationCenter.h that point here:
__IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
@interface UNUserNotificationCenter : NSObject <— 1. 'UNUserNotificationCenter' has been explicitly marked partial here
The build log shows them associated with one of my .m source files that conditionally uses UNNotificationCenter on 10.0 and later, but it doesn't actually tag any of the source lines. It doesn't appear for any other source file, even though the prefix file is applied to all of them.
I haven't seen these warnings in the last few versions of Xcode but I just started noticing this after I updated to Xcode 8.3.1. I have appended a relevant section of the build log below.
Is there something that I should be doing now to deal with this warning? Ideally I don't want to just disable the warning globally but rather deal with the underlying cause for why it's appearing for this particular file.
Thanks,
Steve
-------------------
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
In file included from …/MessageManager.m:1:
In file included from …/Prefix.pch:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
@interface UNUserNotificationCenter : NSObject
^
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
warning: 'UNUserNotificationCenter' is only available on iOS 10.0 or newer [-Wunguarded-availability]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h:34:12: note: 'UNUserNotificationCenter' has been explicitly marked partial here
note: enclose 'UNUserNotificationCenter' in an @available check to silence this warning
6 warnings generated.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden