You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Arkadii Ivanov ff73f8268a
Update TodoApp readme with iOS target (#336)
4 years ago
..
android Add iOS target and app for todoapp example (#166) 4 years ago
buildSrc TodoApp. Updated Kotlin to 1.4.21-2, Compose to 0.3.0-build146 and Decompose to 0.1.7. (#329) 4 years ago
common TodoApp. Updated Kotlin to 1.4.21-2, Compose to 0.3.0-build146 and Decompose to 0.1.7. (#329) 4 years ago
desktop Add iOS target and app for todoapp example (#166) 4 years ago
gradle/wrapper Move to 0.2.0-build128 4 years ago
ios Add iOS target and app for todoapp example (#166) 4 years ago
screenshots Added screenshots for examples. 4 years ago
.gitignore Unify .gitignore across all examples and templates 4 years ago
README.md Update TodoApp readme with iOS target (#336) 4 years ago
build.gradle.kts TodoApp. Update libraries. (#210) 4 years ago
gradle.properties Add iOS target and app for todoapp example (#166) 4 years ago
gradlew Rename app folder to todoapp 4 years ago
gradlew.bat Rename app folder to todoapp 4 years ago
settings.gradle.kts Add iOS target and app for todoapp example (#166) 4 years ago

README.md

An example of Kotlin Multiplatform todo app with shared Android/Desktop Compose UI and SwiftUI (not Compose) iOS.

This example supports the following targets:

  • Android (Compose)
  • JVM (Compose)
  • iOS (SwiftUI, not Compose)

Libraries used:

  • Jetpack Compose - shared UI
  • Decompose - navigation and lifecycle
  • MVIKotlin - presentation and business logic
  • Reaktive - background processing and data transformation
  • SQLDelight - data storage

There are multiple modules:

  • :common:utils - just some useful helpers
  • :common:database - SQLDelight database definition
  • :common:main - displays a list of todo items and a text field
  • :common:edit - accepts an item id and allows editing
  • :common:root - navigates between main and edit screens
  • :common:compose-ui - Shared Compose UI for main and edit screens
  • :android - Android application
  • :desktop - Desktop application
  • ios - iOS Xcode project

The root module is integrated into Android, Desktop and iOS (non-Compose) apps.

Features:

  • 99% of the code is shared: data, business logic, presentation, navigation and UI
  • View state is preserved when navigating between screens, Android configuration change, etc.
  • Model-View-Intent (aka MVI) architectural pattern
  • Pluggable UI - Compose UI for Android and Desktop, SwiftUI (not Compose) for iOS

Running desktop application

./gradlew :desktop:run

Building native desktop distribution

./gradlew :desktop:package
# outputs are written to desktop/build/compose/binaries

Running Android application

Open project in Intellij IDEA or Android Studio and run "android" configuration.

Running iOS application

Open and build the Xcode project located in ios folder.

Desktop