Skip to content
Skip
3.1k

Hiya Skip (Split Mixed)

This is a Skip dual-platform sample app: from a single Swift and SwiftUI codebase it builds a native app for both iOS and Android. HiyaSkip demonstrates a mixed-mode app that connects a natively-compiled Swift model to a transpiled SwiftUI user interface. It contains three modules:

  1. HiyaSkip — the SwiftUI app, transpiled to Jetpack Compose on Android (Skip Lite).
  2. HiyaSkipModel — an @Observable model layer, compiled natively for both platforms (Skip Fuse). It is used directly on iOS, and on Android it is bridged to the transpiled UI via SkipFuse and SkipBridge.
  3. HiyaSkipLogic — a pure-Swift, cross-platform module (no bridging) that HiyaSkipModel depends on.

See the native Swift on Android documentation for more on natively-compiled modules.

It is one of four Skip sample apps that share the same conventional Skip app project layout but differ in their module structure and Skip mode, as shown below.

SampleModulesSkip mode
skipapp-helloHelloSkipfully transpiled — Skip Lite
skipapp-howdyHowdySkipfully native — Skip Fuse
skipapp-ahoyAhoySkipper, SkipperModelfully native — Skip Fuse
skipapp-hiyaHiyaSkip, HiyaSkipModel, HiyaSkipLogicmixed — native model bridged to a transpiled UI

In transpiled (“Skip Lite”) modules, Swift is converted to Kotlin and SwiftUI to Jetpack Compose. In native (“Skip Fuse”) modules, Swift is compiled directly for Android with the Swift toolchain and bridged to Kotlin/Jetpack Compose; see Native and Transpiled Modes for the distinction. skipapp-hello, skipapp-ahoy, and skipapp-hiya include unit tests that run on both platforms; skipapp-howdy omits them.

This repository is exactly what skip init produces — its CI verifies that it stays identical to the generated template — so it can be re-created with:

skip init --no-build --native-model --module-tests --appid=hiya.skip --version 1.0.0 skipapp-hiya HiyaSkip HiyaSkipModel HiyaSkipLogic

This project is both a stand-alone Swift Package Manager package and an Xcode project that builds the iOS app and, using the skipstone plugin, generates and builds the equivalent Kotlin Gradle project for Android.

The app can be tested with the standard swift test command, or by running the test target for the macOS destination in Xcode, which runs the Swift tests as well as the transpiled Kotlin JUnit tests in the Robolectric Android simulation environment. Parity testing can be performed with skip test, which outputs a table comparing the test results on both platforms.

Xcode and Android Studio must both be installed to run the app in the iOS simulator and the Android emulator. Start an Android emulator first (for example, from Android Studio’s Device Manager).

Open Project.xcworkspace in Xcode and run the “HiyaSkip App” scheme. A build phase runs the “Launch Android APK” script, which deploys the app to a running Android emulator or connected device alongside the iOS build. iOS logs appear in the Xcode console; Android logs appear in Android Studio’s Logcat tab (or via adb logcat).

We welcome contributions to this package in the form of enhancements and bug fixes.

The general flow for contributing to this and any other Skip package is:

  1. Fork this repository and enable actions from the “Actions” tab
  2. Check out your fork locally
  3. When developing alongside a Skip app, add the package to a shared workspace to see your changes incorporated in the app
  4. Push your changes to your fork and ensure the CI checks all pass in the Actions tab
  5. Add your name to the Skip Contributor Agreement
  6. Open a Pull Request from your fork with a description of your changes