Add the appropriate dependency for Kotlin coroutines into iosMain section of shared module's build.gradle file.
Implement actual platform-specific properties in System.kt and Dispatchers.kt files. See this and that articles for more details about coroutine dispatchers implementation for iOS.
Implement actual platform-specific class DatabaseDriverFactory according SQLDelight documentation.
The shared (cross-platform) codebase covers the Model (data classes and repositories) and ViewModel (UX logic and retained application state) levels; infrastructure and payload. Therefore, next need to implement the main UI controller in iosApp module and dependency injection. If possible, try to adhere to the approved design and UI logic implemented on the Android side.
Special attention: examine the implementation AutoCompleteTextView.setup() in MainActivity class on the Android side. This method contain more UI/UX logic than we would like. Particularly, asking for matching options for auto-completion, filtering character input, handling errors with matching values, and interacting with the ViewModel level are here.
Resources: application resources (strings and images) related to the model and UI classes are allocated in the shared module. Use Moko-resources library's instruments for access to them.
Reason: reusing shared code.
Implementation:
1) see Kotlin for Cross-Platform Mobile Development for details about multiplatform development and target platform-specific implementation 2) see Kotlin Multiplatform for iOS Developers for setting Xcode and working with a KMM project for iOS 3) see 'Create your first multiplatform application' tutorial for acquaintance with an example of KMM application
Specific steps:
System.kt
andDispatchers.kt
files. See this and that articles for more details about coroutine dispatchers implementation for iOS.DatabaseDriverFactory
according SQLDelight documentation.The shared (cross-platform) codebase covers the Model (data classes and repositories) and ViewModel (UX logic and retained application state) levels; infrastructure and payload. Therefore, next need to implement the main UI controller in iosApp module and dependency injection. If possible, try to adhere to the approved design and UI logic implemented on the Android side.
Resources: application resources (strings and images) related to the model and UI classes are allocated in the shared module. Use Moko-resources library's instruments for access to them.