# Using annotations to improve iOS APIs on Kotlin Multiplatform

DevFeed: [Using annotations to improve iOS APIs on Kotlin Multiplatform](<https://devfeed.tech/articles/using-annotations-to-improve-ios-apis-on-kotlin-multiplatform-25572.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2023/objc-annotiations-better-kmp-api/>)

Author: Marco Gomiero

Published: 2023-09-19T00:00:00Z

Content type: article

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>)

## AI overview

This article explains how Kotlin 1.8 annotations can improve iOS APIs in a Kotlin Multiplatform project. It describes using @HiddenFromObjC and @ObjCName to expose iOS-specific implementations with clearer names while keeping shared business logic and reducing misleading duplicate class names.

## Source excerpt

Kotlin 1.8 has introduced new annotations to improve the interoperability of Kotlin with Objective-C and Swift: @ObjCName: allows to customize the name that will be used in Swift or Objective-C @HiddenFromObjC: allows hiding a Kotlin declaration from Objective-C (and Swift). @ShouldRefineInSwift: it marks a Kotlin declaration as swift_private in the Objective-C API, allowing to replace it with a wrapper written in Swift. You can see the release announcement for more details about the interoperability improvements introduced with Kotlin 1.8.