Hey guys how can I get application version code in...
# ios
v
Hey guys how can I get application version code in iosMain in KMM ? I asked my ios team they provide me some code which is working in iOS side
Copy code
let appVersion = “iOS ” + (Bundle.main.versionNumber ?? “”)
But I don't understand how to use this in iosMain in kmm. Is any other code ?
r
When working with Kotlin on iOS, you’re basically writting Objective-C in Kotlin, not Swift in Kotlin. Next time ask them for Objective-C code, this way you can translate it more easily. This time they would have probably answered with something that, written in Kotlin, would look like this:
Copy code
NSBundle.mainBundle.infoDictionary?.get("CFBundleShortVersionString") as String?
v
@ribesg great thanks a million. I'll remember your suggestion for next time. ✌️
👍 1