https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Raed Ghazal

12/06/2023, 8:22 AM
When i work with swift code in kotlin, the names are usually different (sometimes very different) classes, constructor, functions, enums… how can I easily know what the exact corresponding function in kotlin that represent the swift function? example: in swift:
Copy code
Bundle.main.path(forResource: "", ofType: "")
in kotlin its:
Copy code
NSBundle.mainBundle.pathForResource("","")
but some times its harder to figure, any ideas here?
e

ephemient

12/06/2023, 8:32 AM
look at the names in Objective C
☝️ 1
r

Raed Ghazal

12/06/2023, 8:49 AM
ah great advice, thanks!
j

Jacob Ras

12/06/2023, 9:32 AM
In my head NS stands for Not Swift 😉
😂 3
d

Daniel Seither

12/06/2023, 10:40 AM
You’ve probably already seen this, but for everyone else: one simple way for translating between Swift and Objective-C APIs is to use the dropdown in the top right of the docs.
🙌 1
r

Raed Ghazal

12/06/2023, 10:47 AM
Cool, thanks for the info! I used chat gpt and it also worked 😆
🙈 1
😅 3
4 Views