@ObjCName & Swift-Friendly APIs
Shape exports so Swift call sites read naturally.
Make Swift Devs Happy
Your shared API should read naturally in Swift. A few annotations and habits make the bridge feel native, not bolted on.
Rename with @ObjCName
The @ObjCName annotation lets you give a type or function a different name on the Swift side without renaming the Kotlin one.
@ObjCName("UserService")
class UserRepositoryAll lessons in this course
- How Kotlin Maps to Objective-C
- Suspend Functions as Swift async
- Collect Flows from Swift
- @ObjCName & Swift-Friendly APIs