preprocessor and warnings for deprecated APIs...


(Martine Habib) #1

Hello!

I am working on porting my iOS app to iOS 10, using the new Notification
framework.
However, I still want it to work on iOS 9.*.
So, I invoke both frameworks within if blocks.

When I switch to iOS 10 deployment, I get a series of "deprecated" warnings
on the old API.
Is there a way in Swift to #ifdef the old API in case of deployment on iOS
10?
Something like:
#if SYSTEM_IOS10_OR_GREATER
etc.
Thank you for any help!

Martine
iOS/Android developer