Is there a way to check for Obj-C API availability in Kotlin code? I ran into an issue where I accidentally used an API that was only available on iOS 15 and it crashes on iOS 14.
p
Pavel Lahoda
08/09/2023, 10:10 PM
Yep, that is pretty straightforward. Create something like:
if *#available*(iOS 15.0, *) {
kotlinNativeFunction("Have iOS 15")
}
and call it somewhere inside your iOS code. This will get back to your shared module and you can use it any way you like.