13 karma · joined January 18, 2024
That said, yes, you can easily use #if blocks to write iOS and Android-specific code: https://skip.tools/docs/platformcustomization/
- Skip is based on Swift Package Manager and fully both dual-platform and iOS and Android-specific dependencies.
- Skip has a suite of dual-platform libraries, and for anything that isn't covered, multiple techniques for integrating platform-specific code and libraries. These include being able to use Kotlin right inline with your Swift and mix Compose code in with your SwiftUI.
Now of course Skip can't have complete Android coverage for every iOS framework - far from it. So if you use something on the iOS side that has no Android coverage, you have to create a separate code path for Android, where typically you'll utilize an equivalent Android framework/function. Skip has several mechanisms for integrating Android code, including being able to call Kotlin and Java API directly from your Swift. These mechanisms are also how you can differentiate parts of your Android app as desired, and how we create our own cross-platform libraries.
Lots of options for adding platform-specific code - including being able to directly call Kotlin/Java APIs from your Swift, move back and forth between SwiftUI and Compose, etc.
https://skip.tools/docs/gettingstarted/#existing_development