![]() "->" and "<-" indicate that mapping only goes one createĬompanion member interface FooProtocol. The table below shows how Kotlin concepts are mapped to Swift/Objective-C and vice versa. ![]() You can still use these declarations in your Swift code to create a Swift-friendly API, but they won't be suggested in the Xcode autocomplete.įor more information on refining Objective-C declarations in Swift, see the official Apple documentation. Such declarations get the _ prefix, which makes them invisible from Swift. The annotation marks a function or property as swift_private in the generated Objective-C API. The annotation disables a function or property export to Objective-C, making your Kotlin code more helps to replace a Kotlin declaration with a wrapper written in Swift. If you don't want to export Kotlin declarations to Objective-C and Swift, use special hides a Kotlin declaration from Objective-C and Swift. ![]() See Kotlin Multiplatform Mobile Sample for an example. Kotlin modules can be used in Swift/Objective-C code if compiled into a framework ( see here for how to declare binaries). A Swift library can be used in Kotlin code if its API is exported to Objective-C with Pure Swift modules are not yet supported. See compilation configurations for more details. Objective-C frameworks and libraries can be used in Kotlin code if properly imported to the build (system frameworks are imported by default). Kotlin/Native provides bidirectional interoperability with Objective-C. This document covers some details of Kotlin/Native interoperability with Swift/Objective-C. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |