Skip to content

Kotlin Multiplatform sample project with Jetpack Compose and SwiftUI

Notifications You must be signed in to change notification settings

apter-tech/GitHubUserFinder

Repository files navigation

GitHubUserFinder

GitHub Actions build status

Kotlin Multiplatform sample project with Jetpack Compose and SwiftUI

Check this basic, simple KMP project with latest and greatest libraries. You can also easily learn and keep your knowledge up-to-date in both Jeptack Compose and SwiftUI.

iOS Swift Android Kotlin GitHub

Android iOS

About the project

  • Shared ViewModels 🚀
  • Shared resources (svg, strings) with moko-resources
  • MVVM + Reducer implementation = MVI
  • List and detail screens
  • Favourite user feature with SQLDelight
  • Simple paging functionality
  • Linter & formatter (detekt, swiftlint)
  • Common tests
  • Dark mode
  • Automated dependency update with Renovate
  • GitHub Actions config: GitHubUserFinder.yml
  • GitHub API
  • Coverage report (kover)

Libraries

Check Dependencies.kt for more details

Code coverage

  • 📋 Kover - Kotlin code coverage tool GitHub Repo stars

Use ./gradlew koverVerify koverHtmlReport to verify and generate the coverage report with a custom rule:

kover {
        verify {
            rule {
                isEnabled = true
                name = "Minimum coverage verification error"
                target =
                    kotlinx.kover.api.VerificationTarget.ALL

                bound {
                    minValue = 90
                    maxValue = 100
                    counter =
                        kotlinx.kover.api.CounterType.LINE
                    valueType =
                        kotlinx.kover.api.VerificationValueType.COVERED_PERCENTAGE
                }
            }
        }
    }

After that we can use the Kotlinx Kover Report to add the coverage report to the PR as a comment

IDEs

  • Android Studio Flamingo | 2022.2.1 | with KMM plugin
  • Xcode 14.3