Compile errors in below Xcode 11 when using iOS 13 APIs

Hi,


I’m working on a static library, we are supporting it from Xcode 7.3 but when I used iOS 13 APIs (UIStatusBarManager) by using if (@available(iOS 13.0, *)) even though I’m getting compile errors when I build the project below Xcode 11 version.

Could you please help how we can support the library from Xcode 7.3 even if we use iOS 13 APIs also?

Are there any Macros available for iOS version comparison by code level?


Thanks,

Aruna

Replies

Ios 13 i can't upload

Hi Hasan,


I'm just looking for compile-time version comparison.

Below one is for runtime comparison

@available(iOS 13.0, *)


Thanks,

Aruna

Compile time macros would be used to include or omit code.

If the code is omitted, it would be omitted regardless of the iOS version of the device your code is running on.

Yes Jlilest, we need to use macros, but I'm not able to place those correctly, could you please share those working macros?


Thanks,

Aruna

I think the real solution is to update the framework or find an equivalent that you can use when running in iOS 13.


It sounds like you may be getting warning errors since the project appears to be compiling.

If the compile errors bother you or are causing problems, you need to address them specifically.


Macros won't work to select code for specific iOS versions. You have to use runtime checks to control what code is run based on the version of iOS the app is installed on.
Macros could check to see what iOS versions are available, but iOS13 would always be available in xcode 11.