Not marking this as answered because we should be able to use the new feature available in XCode 9: if (@available(iOS 11.0, *)) which of course also suppresses any potential warnings.
This is the workaround - add in your header:
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
Then in your files that you need to check for version:
In the methods:
We've run into this issue too and it's a pain because this is starting to appear in 3rd party library code. Have you made a bug report? if so I'll vote on it.
I didn't submit a bug report actually - you're right of course I should have done so back in September.
Just fyi, not currently in a position to do so - so if you happen to file one b4 I'm able - I'll of course vote on yours.
1 person found this helpful
Just an FYI for anyone attempting to get around this, we've added a few additions to the distriqt Core ANE that implements the required functionality to get the @available flag working.
Simply by including the Core ANE in your application you should be able to use any ANE that uses the @available flag.
2 people found this helpful
To do this without using a custom DEFINE ( or to use closed source Frameworks which use @available such as latest Firebase )
1. Copy this file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/cl ang/9.1.0/lib/darwin/libclang_rt.ios.a
2. Add this to your linkerOptions in platform.xml
<linkerOptions> <option>-lclang_rt.ios</option> </linkerOptions>
= Happy Days
Hopefully Adobe can add libclang_rt.ios.a to AIR SDK dist ?
*Credit to Eugene Petrenko @JetBrains
Thank You for reporting the issue!
Since the @available API has been made available since iOS 11, make sure that you are packaging the ANE for iOS version 11. You can do so by setting linkerOptions and sdkVersion in your platform.xml for packaging ANE. Below is a sample platform.xml for doing so:
Hi, That's not quite correct. @available was introduced with Xcode 9 but it still works on older versions of iOS.
Please give it try by setting the iOS Deployment Target set as 11.0 in the Xcode and share your feedback.
Sorry but that's not really a solution as the @available flag can be used in a third party framework and setting the deployment target that high will reduce the number of devices we can support with native extensions.