Kotlin Ios App Example

Click the run gutter icon next to the test.
Kotlin ios app example. We started exploring how to share code between our native mobile platforms at the end of 2018 and we wrote a bit about that in a recent post here. As a first step download the materials for this tutorial by clicking the download materials button at the top or bottom of the page. Kotlin multiplatform mobile allows you to use a single codebase for the business logic of ios and android apps.
Single codebase for the business logic with kotlin mobile sdk. Check out the blog post for a detailed explanation of this repository. You only need to write platform specific code where it s necessary for example to implement a native ui or when working with platform specific apis.
Kotlin multiplatform mobile which is also called kmm is developed by jetbrains with contributions from google to use a single codebase of the business logic for android and ios applications. This directory stores the shared code for both platforms android and ios. Thus apis can change with every update.
Kotlin code used by both ios and android app src commontest. Since this is the first time running the app the kotlin. Open the file androidtest kt in shared src androidtest kotlin com example shared.
Kotlin multiplatform project is an experimental feature. Open the file greeting kt in shared src commonmain kotlin com example shared. Common kotlin unit tests used by both ios and android app src main java.
In this tutorial you ll learn how to build an app for android and ios while only having to write the business logic once in kotlin.