[swift-dev] preprocessor and warnings for deprecated APIs...

Martine Habib marhab21 at gmail.com
Wed Oct 5 13:57:55 CDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20161005/31c573ed/attachment.html>


More information about the swift-dev mailing list