Is there a way to check for Obj-C API availability...
# ios
j
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
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.
n
j
Thanks! That seems like the best option right now.