The Swift SDK for Android(swift.org)
460 points bygok11 hours ago |30 comments
bsimpson9 hours ago
The most important question for every cross platform framework is what happens to the UI?

Adobe products (both the Creative Suite, and their Flex Builder environment for Flash app) had their own design system that felt foreign on every platform it shipped on. If you wanted something that felt native, you had to reimplement e.g. Apple Aqua in Flash yourself.

Flutter goes out of its way to do that work for you, aiming for a "Cupertino" theme that looks-and-feels pixel-perfect on iOS.

React Native tries to delegate to platform primitives for complex widgets, so scroll views still feel like Apple's when on Apple's platform.

Just about every top-level comment here is talking about that in one way or another; yet the blog post doesn't mention it at all.

It's possible that Apple/Swift's mindshare among developers will lead to a significant number of apps shipping the Swift version for Android even if it means using Apple's UI, simply because they can't be bothered to make something bespoke for Android. Then again, Apple takes so much pride in its design language that it might not be willing to implement anything that feels good on a platform they don't own. If they were to ship an API-compatible widget toolkit, it might e.g. use intentionally bad spring physics to remind you you aren't on an iPhone.

I wonder how big the community part of this is. Is this an open source project of non-Apple people who are trying to break Apple's platform out of its walled garden? Is a lot of it funded by Apple? Ultimately, that's going to shape a lot of how this plays out.

palata9 hours ago
> The most important question for every cross platform framework is what happens to the UI?

I kindly disagree. The first feature I want from a cross-platform framework is that it lets me write a native UI. That's why I like KMP: I can just share a framework with an iOS app built with SwiftUI.

Sharing business logic makes a lot of sense in a ton of cases and has been done forever (C/C++/Rust/Go libraries, etc). Sharing UI in complex apps, in my experience, always ends up being a "write once - debug everywhere" nightmare.

What KMP (and I'm hoping Swift for Android) bring is the possibility to share a Kotlin (respectively Swift) library instead of sharing code with C/C++/Rust/Go. So that an Android/iOS team can keep using Android/Swift without having to introduce a third language for sharing logic.

virtue38 hours ago
Having worked a long time with client teams as a lead - this is always the biggest pain in the ass.

At one of my last phase startups I started shifting all our business logic stuff into our graphql server and treated it like it was part of the client teams. (we had ios/android/web as independent full apps with a very small team of devs).

Business logic is the real killer. Have one person suck it up and do it in typescript (sorry y'all) on the GQL/apollo server and all the clients can ingest it easy.

Send down viewmodels to the clients not data models. etc etc.

This helped DRAMATICALLY with complexity in the clients.

noduerme2 hours ago
I guess I'm not clear on what you mean about putting business logic in the client. It can't only be on the client side. If you do so, then obviously you have to replicate it on the server to check that the client was sending the right results, no? Not to mention avoiding thread races and double inserts and whatever else may have gone stale on the server before you allow a client to validate something? Even if your code isn't public-facing, the server still needs to check everything. As a solo dev it seems insane to me to ever put business logic in the client, unless the client and server literally share the same typescript codebase for crosschecking ops, and even then the server needs the same code plus additional safeguards. It baffles me that anyone would write a platform from the ground up with primary business logic on the client side, if the server isn't written in the same language. Maybe some simple initial validations and checks to avoid bombarding the server, but the server has to be the central source of truth.
throwup2382 hours ago
That’s the exact opposite of what the GP is suggesting. Read this again:

> Business logic is the real killer. Have one person suck it up and do it in typescript (sorry y'all) on the GQL/apollo server and all the clients can ingest it easy.

Move the logic to the GQL retriever so that clients don’t have to implement business logic.

noduerme42 minutes ago
Yeah, I understood what they said. I'm wondering why the previous owners of the code decided to put business logic in the client.
weird-eye-issue8 hours ago
So your takeaway is that business logic should be done on the server. Hasn't it always been like this?
hbbio6 hours ago
Has been the true core vision of the web if not mobile. If I remember correctly, that is how the original Basecamp was implemented, or Craigslist (still is?)... or this very website
weird-eye-issue5 hours ago
Also I just realized the irony of them using GraphQL. They've really come full circle
andrekandre7 hours ago

  > What KMP (and I'm hoping Swift for Android) bring is the possibility to share a Kotlin (respectively Swift) library instead of sharing code with C/C++/Rust/Go. So that an Android/iOS team can keep using Android/Swift without having to introduce a third language for sharing logic.
have gone down this route before, and tbh the biggest issue is dev ux (ios devs cant debug easily, model mismatches vs kotlin e.g kotlin exceptions cant be caught from swift) and in the end even kotlin multi platform isn't the same as kotlin for android, so in a sense you are still introducing a 3rd language after a fashion...

if you can fix the dev issues and have a dedicated team behind the shared logic it could work out, but still then again if you also have a website your re-implementing that logic on the front-end twice...

airspeedswift5 hours ago
> e.g kotlin exceptions cant be caught from swift

FWIW the approach that swift-java takes in managing interop with Java (and potentially Kotlin) function calls means it is perfectly possible to to catch exceptions thrown by the JVM using wrappers that catch and rethrow them as Swift errors. So there would be a distinction here with bringing Swift calling into JVM-based code running on Android.

raspasov4 hours ago
React Native is pretty good at cross platform but yes, it must be tested right away on all platforms.

Retrofitting an iOS-only React Native app to Android later is possible but can be of a pain, at least initially.

timcobb6 hours ago
> Sharing UI in complex apps, in my experience, always ends up being a "write once - debug everywhere" nightmare

Amen!

timsneath9 hours ago
It's worth noting that this doesn't add any expectations for how your UI is built. The example shown in the screenshot continues to use Jetpack Compose (Android's native UI) with Kotlin invoking Swift business logic. You can also use other UI frameworks on Android, of course, including some that are written in Swift.

One nice thing about this implementation is that it shares many of the same characteristics as Swift on other platforms: unlike some common alternatives, it's not garbage collected but uses reference counting; it uses the same underlying libraries, concurrency primitives and memory model.

Excited to see how folk use it... it's technology that will hopefully springboard some other interesting innovations.

[Disclosure: I work on developer tools and frameworks at Apple.]

wffurr8 hours ago
How does transpiration work without GC? I would think all the Kotlin equivalents would be GC heap allocated objects.
timsneath8 hours ago
This doesn't transpile. It cross-compiles to Android architectures using the NDK. You can see a very simple "hello world" example at the bottom of this article:

https://www.swift.org/documentation/articles/swift-sdk-for-a...

marcprux8 hours ago
The Swift SDK for Android doesn't specify or mandate any user-interface technology, but leaves it open for other projects to build upon. For example, Skip.tools re-implements SwiftUI for Android by bridging it to Jetpack Compose, so you can use the same codebase for both your business logic as well as UI layer.

We write about it at https://skip.tools/blog/fully-native-android-swift-apps/ and an example of an app on the Play Store that demonstrates this is the Skip Showcase app: https://skip.tools/docs/samples/skipapp-showcase-fuse/

[Disclaimer: I work on the Skip product, and I am also a founding member of the Swift Android Workgroup and am the release manager for the Swift SDK for Android]

bsimpson7 hours ago
Appreciate the response!

Respectfully, the demos on your page look like impostors on Android. For apps that wouldn't bother supporting Android in the first place, maybe this is an improvement. But for apps that want all customers to feel considered, that's not a direction I would recommend.

Would still like to see a call out to this in the blog post above ("For UI, you can use Swift for business logic and use Android's SDK to create the interface. Or you can use a library like our partner skip.tools to write SwiftUI apps directly.")

marcprux7 hours ago
> the demos on your page look like impostors on Android

On the Android side, Skip apps utilize Jetpack Compose directly, which is the officially recommended toolkit for creating Android apps these days (https://developer.android.com/compose). It isn't mimicking native UI like other x-platform tools, but is actually using the Google-recommended API.

kridsdale38 hours ago
The Browser Company did an amazing job of porting SwiftUI to Windows, where the element primitives in the language map to native Windows UI C++ classes under the hood.

Perhaps the future of Swift for Android is similar, where SwiftUI will map to Jetpack elements. That would be cool.

Remember on iOS and MacOS, SwiftUI is not "native". It's a description language that system frameworks interpret and create NSViews and UIViews and CGLayers etc out of.

aatd865 hours ago
Is their code available somewhere.

I need this for UIKit so that I can make my UIs in Go. I have the gist of what it would require but have yet to implement everything. (if swiftUI allowed more control over the UI tree, I would even target it but full declarative à la react with vdom diffing is no bueno for fine grained rendering control)

rkapsoro4 hours ago
They didn't port SwiftUI to windows; they wrote a Swift wrapper for WinUI. Impressive in its own right, but not SwiftUI.
wahnfrieden5 hours ago
It exists already.

SwiftUI to Jetpack Compose: https://skip.tools

And a less mature but very interesting project with a SwiftUI-like API for UI across macOS/Linux/Windows plus some emerging support for Android and even a TUI target contributed by Miguel de Icaza: https://swiftcrossui.dev

> It's a description language that system frameworks interpret and create NSViews and UIViews and CGLayers etc out of.

This is out of date. FYI parts of SwiftUI are "native" now. Notably the new Liquid Glass UI was written in "native" SwiftUI. UIKit and AppKit actually wrap SwiftUI views to render Liquid Glass now. Although SwiftUI-exclusive APIs have always existed, this was a notable step in a new direction and suggests the future of UIKit and AppKit is a unified "native" SwiftUI implementation.

They've also been ripping out UIKit/AppKit implementations of SwiftUI views... IIRC List is no longer a UITableView for instance (could be confusing with another component though).

mikeocool9 hours ago
> It's possible that Apple/Swift's mindshare among developers will lead to a significant number of apps shipping the Swift version for Android even if it means using Apple's UI

It doesn’t sound like this release includes bringing SwiftUI or UIKit to android, so unless you did a ton of work to replicate it (ala flutter) using Apple’s UI on android probably still isn’t really possible.

mkhalil2 hours ago
Huh? Did you read the link? Did you notice the ONE screenshot clearly shows the app has a material-ui look.

I'm going to say this because I think you might not know this, but also because I think many others might not have thought about this:

Almost always, a programming language is UI agnostic. Swift SDK for Android means: You can now write Android Apps in Swift. This doesn't magically include Apple's components / SwiftUI. When you write code for a platform, specifically an SDK for an OS, all you do is expose that platform to that language.

So, as long the SDK/bindings are there, a new "Window" means whatever a the OS thinks is a Window. A Button is what is defined (or exposed/binded to) as a Button in Android.

Swift was sorta released for Windows: a new Window looks like a generic Win32 Window. The same one you would get if you used C, C++, Rust, etc..

All your examples are GREAT examples to explain how this works: - Flutter has "Cupertino" to allow people to use Flutter to make Apple apps, and not have to learn names/methods/interface of the native Apple UI. - React Native: A LOT of work was put in to make/bind Apple native objects to a React component. And the same for Android.

So again:

The Swift SDK for Android means you can write your Android apps in Swift. The same apps you might of wrote in Java or Kotlin, you can now use Swift. Meaning whatever it looked like in Java/Kotlin (using native api's), it would look like in Swift.

The SwiftUI, Apple's component library written/exposed to Swift, is something completely different.

al_be_back4 hours ago
i think traditional UI should be decoupled from the language - only providing CLI and web UI (w3c web standards).

Apple's ui is very nice, but you're stuck with a whole ecosystem for life. If you want to cross-platform, as you mentioned, well, all hell breaks loose: React & co, Flutter, web assembly.

a unified, all-batteries-included system is excellent for the manufacturer/provider - they can plan, invest, manage and rollout products at a desired rate. but for developers, third-party, and consumers is very costly, intense and risky.

fun-fact from Steve Jobs bio, he was interviewing a tech hopeful for a job, the guy showed him a prototype of what would become the Dock (aqua + animations), created using an Adobe product. Abobe etc had powerful, flexible platforms - unfortunately the market was driven by eager tech geeks - so it was easy to get curried away with fancy UIs. However, that was (20 years ago) an educational issue - not a tech issue.

akmarinov1 hour ago
Didn’t Flutter decide not to support Liquid Glass, because it’ll be too much work?
WhereIsTheTruth9 minutes ago
Nobody cares about native UI, not even Apple, the strength of a UI toolkit is to empower creative design while retaining consistency and intuitiveness across devices

Only the UX has to feel native, the pixels are yours

ChrisMarshallNY5 hours ago
Looks like this is package compatibility, not a cross-platform UI system (although maybe that’s in the works. SwiftUI could probably port well).
afro883 hours ago
Think of this more like Kotlin Multi Platform. Shared logic, not UI.
rustystump7 hours ago
Very unpopular opinion but i like apps that ashew looking “native” for an original ux. Maybe it is my love for gamedev and all the crazy designs they come up with but i personally loath boring uninspired native apps esp when the native ux is terrible.

Apple wants everyone to conform because historically their ux is on point but the last update really reinforces my view.

realusername25 minutes ago
The debate has been settled anyways, none of the top apps (Facebook, Whatsapp, Youtube, Tiktok..) uses the native design, users simply do not care.
beautron5 hours ago
I share your unpopular opinion.

While I understand that having identical UI elements across apps aids in discoverability, I just love it so much when an app has its own bespoke interface that was clearly made with love.

Like you, it might be my love of games that has given me this preference. Would StarCraft II have a better UX if its menus used the standard Windows widgets where applicable? I think certainly not. And I think the same can be true for many non-game apps.

Razengan7 hours ago
> The most important question for every cross platform framework is what happens to the UI?

For that, there needs to be a single definitive agreement on UI somewhere.

Like what does it mean to be a "list"? How does it behave with mouse, touch, keyboard?

How many different kinds of lists? (for example, a list for "favorites" behaves slightly differently than a list for "bookmarks", vs lists of "products/offers" and so on)

I bet any example you can give I or others can nitpick some flaws in that.

Hell, there are differences of opinion right off the bat: Should content move up when I scroll/swipe down or move down when I scroll up?

trevor-e10 hours ago
Very excited to see this as an official project!

I've been toying around with multiplatform frameworks like RN and Flutter for a side project of mine but they never feel right. I'd rather use the native UI per platform and have a nice way to share business logic. KMP exists but I think for most developers wanting to build an app it's more common to build for iOS first, and then port to Android later if the app gets traction. With a little foresight of keeping shared code in a Swift Package, it seems like that's getting more and more possible which is great to see.

a3w9 hours ago
> but I think for most developers wanting to build an app it's more common to build for iOS first, and then port to Android later if the app gets traction.

Is it? There seem to be a hundred million Java developers out there, that can do an Android app, plus even release that in-house or with minimal registration fees if single dev/sideproject.

For Objective-C/Swift, there seem to be ten percent as many devs.

I always only tinkered with Android apps in my spare time, but never managed to deploy anything to iOS.

Also, outside the US, iPhones are a 10 % niche product in private hands, but companies might use a lot of iPads or provide iPhones as work phones, so perhaps companies do think of both platforms as second class citizens (behind windows/browser as two other "OS-like" primary platforms)

cosmic_cheese8 hours ago
It probably varies from area to area, but in the US iOS first is common.

Having developed both, it makes sense.

iOS is by far the more profitable of the two platforms and its support burden is substantially lower — far fewer versions to think about with the bulk of users running 0-2 versions behind, single form factor (only size variants), zero manufacturer skin quirks/bugs to deal with. It’s a more fertile environment for getting up and running and getting the core product shaken out.

Android can come later when you’re out of rapid iteration and have the bandwidth to deal with the idiosyncrasies of the Android world.

deaux1 hour ago
In large parts of the world, the iOS and Android revenue share are roughly 50/50 with the higher $/user of iOS and the higher market share of Android cancelling each other out. And that means everyone makes hybrid apps unless they're in a niche where that's impossible, which is rare. Only if they become very successful or raise massive funding (for that country), then they might switch to two native apps.
Jcampuzano27 hours ago
It's probably a US centric take you're replying to.

Having worked at multiple companies making apps in the US and the company I work at right now which is a company almost everyone knows the name of and the vast majority of our revenue comes from our native apps - practically every feature we build is iOS and web first and only if it performs well do we even consider adding to android most of the time. And it's primarily because product/execs know iOS users are more likely to pay for things.

It's sad as an android user myself, but android is very much a second class citizen in the US

twof9 hours ago
It's not really about the number of developers. If you're running a company in the US at least, most of your revenue is going to come from iOS users.
makeitdouble9 hours ago
The US still has a strong iOS market share, shipments just never go below 50%

https://counterpointresearch.com/en/insights/us-smartphone-m...

giobox8 hours ago
Even ignoring global OS marketshare, iOS app store customers just simply spend a lot more money per user on the App Store vs Google Play (Google's Android app store). You gotta go where the money is to some extent to get paid.

Global revenues on the iOS app store have always been significantly larger than Google play, even with only ~30% of the global smartphone market.

> https://sqmagazine.co.uk/iphone-vs-android-statistics/

makeitdouble4 hours ago
Average amount of money spent means little in the context of parent's comment (revenue for a US company).

For instance, if you're Netflix, do iOS user bring you more revenue in the US ? What if you're Hertz ? What about Walmart or Costco ? The only factor will be how many of your users are on iOS vs android. It's a different story if you're a gaming company and target whales of course.

xethos2 hours ago
Even if you're a social media company, where network effect is everything and getting into everyone's pocket matters, you can still go iOS first. Snap ran with that strategy at first, and it hardly killed the company.

Notably, that's a situation that actually matters for cross-compatibility. There's no web client for SnapChat. Hertz & Costco could point Android users to the web with few repurcussions, IMO

makeitdouble1 hour ago
This is still about the actual market share. iOS being 55%+ of the market makes that strategy viable in the US. You'd start with android instead if you were to launch in Korea for instance.
disiplus9 hours ago
for us its pixel phones, you can choose iphone if you want but most of us want pixel. so for me its macbook + pixel. I think the iphone only is unique to US.
palata9 hours ago
> KMP exists but I think for most developers wanting to build an app it's more common to build for iOS first

This sounds US-centric to me.

The advantage of KMP is that it is pretty mature and it is used in big apps like Google workspace (Google Docs etc), so it feels like it may be in a really good position.

I used to be exited about Flutter when it started, but the speed of major releases (by the time I had rewritten my app for Flutter 2, Flutter 3 was out, or something like that) and it did not seem to get so much traction (Dart is fun, but well).

KMP builds on top of Kotlin, with big investment from JetBrains and Google. That looks extremely promising to me.

frankus9 hours ago
I think business-logic-in-JavaScript is something cross-platform folks shouldn't snooze on either, with the usual caveats of not doing anything performance-critical or where an asynchronous API would be awkward (to be clear, using JavaScriptCore or QuickJS or the like, not just running in a WebView)

But it'll run on iOS (v7.0+), Android (I think more recently) and of course web and server-side. And most importantly, it's hot-reloadable, as long as you don't run afoul of platform gatekeepers (i.e. use it for bug fixes and minor behavior changes, not like whole new features).

One of the frustrating things about mobile development is that once you ship a version, that version will almost certainly be running on at least someone's device indefinitely without being upgraded. My day job is even on step further back in that we have to get our customers to update the version of our SDK that they're integrating (which for many of them means contracting out because they don't have an in-house mobile dev team), before they ship an app update, which then needs to be installed by end-users, whose device might not even support the new deployment target…

(I've been trying to sell this to the bosses for the last 9 years or so, and never gotten the go-ahead, so there could be aspects I'm missing, but it always seemed like a huge missed opportunity).

trevor-e9 hours ago
OTA updates are definitely nice to have and I'm surprised there's not a way to do so with native iOS since RN and Flutter already support it. Technically it is possible with dynamic frameworks.

In practice though it's somewhat easy to workaround the lack of OTA with dynamic server configuration for clients.

giancarlostoro8 hours ago
It used to be allowed, then Apple banned it outright. You're technically not supposed to do it even with RN...
tcoff915 hours ago
This is not actually true. It’s allowed as long as you don’t make significant alterations to the app as a way to get around the App Store review process. It’s confusing because there are 2 areas of the policy that seem contradictory on this matter, but it is allowed.
wahnfrieden5 hours ago
This is false.
bpavuk9 hours ago
yes. there is an aspect you are missing.

no one in their right mind wants to bundle Chromium with every app install, and every Discord user hates mobile Discord app, which is, guess what? uses Chromium!

NSUserDefaults8 hours ago
For JS driving the business logic you do not need a browser to run it. On iOS there is JavaScriptCore and there are other Javascript runtimes out there that are quite small.

That said, it is true that Javascript may not be the right choice for every app and some developers may be used to better language features and performance than that.

iknowstuff8 hours ago
Your profile is full of incorrect assertions about software. What do you do for a living
cyberax9 hours ago
React.Native doesn't use Chromium.
liqilin15674 hours ago
Just curious - how does React.Native implement native UI if it doesn't use chromium
notpushkin4 hours ago
By mapping some “low-level” components to platform primitives: https://reactnative.dev/docs/intro-react-native-components
hokumguru4 hours ago
It’s more complex now since they shipped the new renderer, but essentially serializes the react UI tree to JSON and passes it to native which parses and renders native components
adityapurwa4 hours ago
React Native asks the native layer to render the UI natively.
icar9 hours ago
At Proton they use Rust for shared logic (their claim is more than 80% of the codebase iirc), and platform specifics for the rest.
bbkane9 hours ago
https://proton.me/blog/authenticator-rust - I think this is what you're referring to? Looks really nice
ivm9 hours ago
This is already possible with .NET and MvvmCross: a shared core library plus native UI projects for each platform. UIKit feels great in C# and it’s all been working quite well since Xamarin times, with access to the Nuget ecosystem.
trevor-e9 hours ago
Xamarin with .NET and MvvmCross falls into the same bucket as RN and Flutter IMO, unless something changed since the last time I looked.
ivm9 hours ago
Not at all, but it’s important not to mix up Xamarin (nowadays just .NET) which is basically native bindings for C# and Xamarin.Forms UI framework (nowadays MAUI) which is write-once approach like RN.

The former is exactly what you are talking about: building native UIs twice and then sharing the common logic.

trevor-e8 hours ago
Very neat, thanks for explaining. The only drawback I've seen in the past with apps using .NET is the binaries end up pretty huge due to the runtime. I'm assuming that's still the case here? I wouldn't be surprised if this is also an issue with Swift for Android but I haven't looked yet.
ivm8 hours ago
It's not too bad, about 12-15 MB for the runtime on iOS. I'd say the main downside compared to other cross-platform frameworks is the lack of official hot reload (it's possible but really clunky) for building UIs.

Otherwise, I’ve been working with it since 2018, my app now has around 500k installs on both stores, and I’ve encountered very few issues related to the stack itself. Mobile .NET has been steadily improving, and LLMs have made the two-native-UI approach much easier: after building an iOS UI, I ask Claude to repeat it on Android for the same view model and get about 80% done instantly.

pzo9 hours ago
react native do uses native UI per platform in contrast to flutter or compose multiplatform. React Native improved a lot - it's not the same technology that has been 5 years ago. Especially this year there were plenty of improvements also regarding speed but in react native and community plugins (new architecture rolled in, react compiler, hermes v1, nitro modules, flash list v2, legend list, react native skia, react native webgpu, expo use dom) Tooling in JS/TS ecosystem also improved a lot.
trevor-e9 hours ago
Yes it uses native UI by wrapping the underlying frameworks, but that still means there is a layer in between that has to be updated with fixes and new features. Every RN project I've tried in the past turned into a dependency mess since you find edge cases that are not supported by the framework.

It's definitely gotten better like you said but I just prefer to work with the native platform code even if it's a bit of extra effort.

TheJoeMan10 hours ago
Does this project tie in to the SKIP transpiler? https://skip.tools/blog/bringing-swift-to-android/

I have an existing Swift / SwiftUI app that I am looking to port to Android, and have been not wanting to move to React Native.

marcprux8 hours ago
Yes, Skip has been using our preview release of the Swift SDK for Android in our Fuse mode for over a year, and it has proven to be very popular! You can see our blog post about using it to build a completely native SwiftUI app for Android at https://skip.tools/blog/fully-native-android-swift-apps/

To clarify a couple of other comments about transpilation vs. compilation, Skip has two modes: Skip Lite, whereby your Swift code is transpiled into Kotlin, and Skip Fuse, whereby Swift is compiled natively for Android using the Swift SDK. Skip Fuse and Skip Lite work side-by-side, where Skip Lite is used to provide bridged integration to many popular Kotlin frameworks on Android (Lottie, Firebase, Stripe, etc.). You can read about the comparison between the two modes at https://skip.tools/docs/status/ and see a subset of our available modules at https://skip.tools/docs/modules/

We are very excited that the Swift SDK for Android is now official and we can switch over from using our own preview build of the SDK to the officially supported one.

joanniso10 hours ago
Yes, Skip is a major contributor to this effort!
wahnfrieden10 hours ago
You don't need to use the transpiler anymore. Skip added native Swift execution on Android recently. It has much greater compatibility than the transpiler (though they maintain both).
ls-a10 hours ago
Thank you. Please kill RN and Flutter already. I'm done with square UI apps that handle touches after two days
turtlebro9 hours ago
You can set the corner radius to whatever you like in Flutter, also the framework is quite fast, if an app doesn't respond to touches it's likely a poorly made app
ryeights9 hours ago
Flutter has a long-standing issue where every interaction is subject to a 1-frame delay on iOS (P2 since 2022)…

https://github.com/flutter/flutter/issues/110431

Not to mention the stuff with shader compilation lag

turtlebro8 hours ago
Sure you can find some issues if you look at it hard enough. In the real world scenario, it's very possible to ship a performant, functional app in Flutter and has been for some time now. It also brings some of the best development experiences with Dart, consistent declarative paradigm & hot reload. Like all things, it's a trade off, for me it's very hard to merit maintaining 2x native apps.

There are many, many people out there shipping Flutter apps, and many, many users using those apps. So please stop the hate maybe?

ryeights8 hours ago
I'm not hating, I'm actually working on a Flutter project currently. I don't understand why we need to pretend like the platform is perfect
rumori8 hours ago
I’m curious to hear where you think this is a showstopper. I’ve been testing some Flutter apps lately and other than some mismatches in platform UI elements they have been smooth. I wonder what you would think of apps like Kagi News.
ryeights8 hours ago
I don’t mean to say it’s a showstopper, but it is certainly noticeable to anyone accustomed to using iOS devices. I suspect the situation on Android is better where Google has access to the native platform code.

Flutter has a secondary problem which is (IMO) a dearth of well-made libraries and showcase apps. Most everything feels half-baked.

The Kagi News app, which I have just installed, doesn’t seem to fall into this category. But like most Flutter apps the fully Material design makes it feel very out of place on iOS. Flutter typography is still broken, with characters tracked out way too far. And the scrolling and touch interaction feels, well, Flutter-y. It’s inherent to the platform

bitpush9 hours ago
I have no love for RN and Flutter, but what makes you think Swift on Android will be even remotely close to what Flutter and RN has?

If anything, Apple will launch this and quickly forget this exist.

bpavuk9 hours ago
although Apple has tremendous influence over Swift, Swift for Android is a grassroots effort, as said in the link. if community needs it, community will maintain it, and Apple won't get in the way. why would they?
bitpush8 hours ago
I guess that goes to the larger point then. OP was saying Swift for Android will finally solve all the issues of Flutter & RN, presumably meaning Apple with its $$ and might will do it.

If it is a grassroots project, it has even bleaker outlook then? I wish them success however.

lenkite1 hour ago
> Please kill RN and Flutter already.

Just No. Nobody will kill >30% of apps on the iOS store. Flutter is simply a massively superior development experience overall compared to the horrifying disaster that is SwiftUI. SwiftUI is so utterly pathetic that more than a third of all apps are now being written in Flutter.

"The compiler is unable to type-check this expression in reasonable time" -> one of the most atrocious and common errors that increases cortisol levels and reduces life expectancy amongst mobile developers.

Please kill SwiftUI already. For the sake of Humanity.

realusername15 minutes ago
Having worked with Flutter, I also have the same opinion, I don't think you could pay me enough to use xcode and care about all these half documented apple frameworks.

The app build and upload process is painful enough as it is, I don't want more of it.

mosura10 hours ago
I hope they actually stick with this. Swift embedded, for example, is a sort of proof of concept more than viable platform, and you end up battling that more than the problem you are trying to solve.

It is a shame because aesthetically Swift is easily the nicest of the modern safe languages, but there have been really odd noises in the community about project leadership that sour things.

nicce20 minutes ago
> Swift embedded, for example, is a sort of proof of concept more than viable platform, and you end up battling that more than the problem you are trying to solve.

Yet Apple has managed to create WatchOS. I don’t know what is the portion of Swift, however.

ranie937 hours ago
guard let self = self else { return }
mojuba1 hour ago
There's a shorter form of it:

  guard let self else { return }
which annoyingly the AI's don't know about.
timsneath6 hours ago
Ha! But that's not semantically meaningful Swift code in any normal context, nor is it idiomatic. `self` is equivalent to `this` in C++, and is never normally null.

You use this construct for unwrapping nullable fields, for example something like this:

guard let httpResult else { return }

Note that you don't need to assign the value to itself in modern Swift. This line takes an optional (httpResult?) and returns early if null. If not, you can use it with strong guarantees that it's not nullable, so no need for ? or ! to unwrap it later in the scope.

CBMPET20016 hours ago
I've seen that exact pattern used to safely unwrap a weakly captured 'self' within a closure (to avoid retain cycles)
akmarinov1 hour ago
This can now be guard let self else { return }
jajuuka10 hours ago
"You got Kotlin in my iOS."

"You got Swift in my Android."

bradleyy10 hours ago
Perfectly delivered, the Reese's commercial that keeps on giving. Although to fully match the analogy, there'd need to be some form of Kotlin+swift hybrid with a crinkly wrapper.
ignoramous10 hours ago
Kotlin on iOS is statically compiled and interops with Swift/ObjC natively. Don't think KMP on iOS is even running a VM like Flutter has to with Dart?

https://kotlinlang.org/docs/native-overview.html

oblio9 hours ago
How solid is Kotlin on iOS?
tomovo9 hours ago
If you mean Kotlin Multiplatform, it works pretty well. Not easy to debug, the GC is a bit weaker than the Android implementation and optimized builds can get crazy slow as the app grows. The interface uses auto-generated ObjC headers which are very verbose. Native Swift API is in beta. Overall still worth it for a commercial app, I think.
afro883 hours ago
We use it in my team and it works well enough, but iOS is a bit second class citizen. Everything translates to Obj-C (NSObject at the root), so even something as simple as a data class becomes NSObjects with a cumbersome dev experience rather than a native swift enum.

We're looking forward to native swift export to go stable - it's currently experimental / beta.

mr7uca9 hours ago
incremental native builds are getting better at least
w10-18 hours ago
I read this announcement mainly as proving the success of the new support for SDK's. Previously, supporting another platform required invasive hodge-podge of CMake tangles at best.

Swift SDK's are a way for anyone to support any platform, as proven by the Android guys doing it on their own. There are also SDK's for Linux, wasm, and embedded (and soon, windows?). So long as you play by SDK rules, Apple won't stop you from porting Swift to a new platform, even on competitive platforms like Android.

(The inter-op story with the JVM languages is still being written; it reduces to either the C/C++ FFI or the two incomplete duals of Java's legacy JNI and newer FFI/Memory interfaces. Prototypes work fine when the semantics are the same, but beyond that, there be dragons. Cross-platform UI frameworks are similarly (and likely eternally) afflicted with bright and dark spots.)

outadoc10 hours ago
I'm a big lover of Kotlin Multiplatform, but I think this is pretty cool anyway. I could imagine making a native Swift library shared between the platforms for memory-sensitive work. I'm not sure about using it to write an app's entire business logic, KMP is going to be more mature for a while for this.
oblio10 hours ago
Do you build desktop apps, too, with Kotlin Multiplatform? How mature is it overall?
icar9 hours ago
I want to know this as well. My only interaction with a Kotlin Multiplatform app is Jetbrains Toolbox, and it's slow to start, has a lot of input lag and overall feels sluggish.
mr7uca9 hours ago
Jvm desktop is honestly the target with the best support. I always build on desktop during mobile dev first because I don't need to deal with connecting a phone or emulator. Second resizable windows by default is so helpful when building for many screen sizes. Also it has hot-reload now
nhumrich2 hours ago
Does this mean there is no longer any excuse to not put iMessage on the iPhone?
prirai2 hours ago
You mean android?
lukko10 hours ago
I would love if I don't have to port my whole iOS app to Android manually. How exactly would this integration work if say business logic is handled by Swift - I'm guessing UI and SwiftUI would not be supported initially?

My app [0] uses a lot of metal shader code - I'm guessing there's no easy way to bring that across?

[0] https://apps.apple.com/app/apple-store/id1545223887

fooker10 hours ago
It'll take you thirty minutes to port the shaders with a modern LLM.

I am not joking. I have done this. Shaders are pretty simple. You'll have some weird artifacts but thats more because of platform differences than translation errors.

joanniso10 hours ago
Metal cannot be used on Android. Your business logic can be ported - if it's separated as a library. If you don't want to separate it, Skip can handle bridging a lot of Apple libraries including SwiftUI.
lukko10 hours ago
Thanks - I see, so swift packages for everything.

What would be the equivalent shader / GPU language on Android? OpenGL?

thomspoon10 hours ago
OpenGL or Vulkan, you might be able to have some luck transpiling metal shaders to spirv-cross at a cursory look
wahnfrieden10 hours ago
Sometimes it is easiest to have an agent like Codex rewrite the shader instead...
rahkiin10 hours ago
Vulkan with glsl to spirv compiler would be equivalent
hoppp10 hours ago
Yeah I would also like to see SwiftUI but its apple ecosystem only.
wahnfrieden10 hours ago
https://skip.tools ported SwiftUI to Android.
pzo9 hours ago
Happy to have it but I worry it's too little too late. I see more and more new projects choosing React Native, Flutter or Jetpack Compose Multiplatform. It's gonna take multiple years for apple or community to catch up to those. Also they should open (source) up xcode tooling for other IDE to get any better cross-platform adoption.
palata8 hours ago
I have been sharing code between Android and iOS for a long time. Sharing the UI has always been a nightmare for non-trivial apps.

What makes sense to share is complex libraries, and usually I have been doing that with C/C++/Rust libraries. But it means that the team now deals with Kotlin, Swift and one (or more) of those "sharing" languages.

What I believe KMP and Swift for Android bring is that teams will be able to share libraries in Kotlin/Swift, so that they can keep writing in their preferred language without having to introduce C/C++/Rust.

I believe this approach is vastly superior to any kind of framework that tries to share the UI. Mobile devs, in my experience, want to use the native tools: Kotlin for Android and Swift for iOS.

flakiness10 hours ago
This looks like a Fluttter competitor where the UI is rendered by the Swift SDK side (vs Android-provided library).
afavour10 hours ago
This is really interesting. I’ve made cross platform mobile libraries before and ended up using Rust… which was fine. But there’s a huge built in advantage to using a language one half of the problem is already fluent in. Curious to see how well it combines with Swift/Webassembly.
guelo9 hours ago
Less necessary to be fluent nowadays with LLMs.
orliesaurus9 hours ago
Interesting to see excitement around this release...

BUT beyond cross‑platform hype there's a practical question... what developer tooling will look like... Are we getting first‑class debugging, package management, continuous integration for Android targets...

ALSO adoption often comes down to licensing and governance... open SDKs thrive when the steering group is transparent and responsive...

And it's worth remembering that bridging two ecosystems isn't just about code... it's about aligning design idioms, APIs and expectations... Without that you end up with uncanny valley apps...

andrekandre7 hours ago

  > Are we getting first‑class debugging, package management, continuous integration for Android targets...
the most important part imo.

i'd love it if you could pull/push and build/debug changes to the shared code from android studio and build it all together there, that would reduce a huge amount of friction...

flutas7 hours ago
IMO the implementation (for me at least) is ... terrible. Why reach for this when it's, at the end of the day, just the exact same as NDK work in C++ but in Swift.

You have to use Kotlin / Other UI setup anyways (or their fully-native example, use OpenGL to draw the screen[0]), and on top of that statically assign the package path and class name in the Swift code, while making it an external func in the kotlin code[1]. You then also get to deal with the annoyances that come up with native libs.

kotlin side: /* * A native method that is implemented by the 'helloswift' native library, * which is packaged with this application. */ external fun stringFromSwift(): String

swift side: @_cdecl("Java_org_example_helloswift_MainActivity_stringFromSwift")

[0]: https://github.com/swiftlang/swift-android-examples/blob/mai...

[1]: https://github.com/swiftlang/swift-android-examples/tree/mai...

ktoso6 hours ago
It's worth pointing out that the example you linked with the cdecl is not showcasing the swift-java interoperability but using "raw" JNI patterns as if you would do it with C.

This example does showcase the interoperability: https://github.com/swiftlang/swift-android-examples/tree/mai... you don't have to annotate or write any "weird" cdecls or really touch JNI details yourself when using the swift-java interop support https://github.com/swiftlang/swift-java

chrsstrm11 hours ago
I'm just getting started in iOS development as a hobby, but what does this mean? Can I now build my app in Xcode with an Android target and use that binary in the Play Store? It surely can't be that easy now is it?
objclxt10 hours ago
> Can I now build my app in Xcode with an Android target and use that binary in the Play Store?

No. The vision document[1] lays out the direction of travel. Currently the focus is on shared business logic and libraries, rather than full native applications (although that's certainly a goal, albeit a very long term one).

[1]: https://github.com/swiftlang/swift-evolution/pull/2946/files

thenaturalist10 hours ago
What do you mean?

This doc you linked is from August.

The blog post from today includes, in fact at the very top an XCode Swift project emulating a Pixel 9.

The docs include a detailed Getting Started for Android and they even have an Android examples repo.

Hence the SDK.

By all means, it very much is possible to build Android Swift apps in XCode.

https://www.swift.org/documentation/articles/swift-sdk-for-a...

joanniso10 hours ago
The post doesn't display Xcode but Android Studio. While with Skip you can build & run through Xcode, that's not something we support right now.

You can build the Swift part in Xcode, VSCode or your favorite editor. But the Android builds don't work with Xcode today.

joanniso10 hours ago
The SDK doesn't quite work that way, your iOS-specific dependencies like SwiftUI and UIKit aren't available. For SwiftUI development, [Skip](https://skip.tools/) has a transpiler that translates your SwiftUI code into Jetpack Compose.

Without Skip, you can still share other code through JNI - similar to Kotlin Multiplatform.

Larrikin10 hours ago
The reverse is slowly becoming a possibility. Jet Brains just announced another improvement with Swift Export. https://kotlinlang.org/docs/native-swift-export.html

But it's not there yet

marcprux8 hours ago
An example of an Android app that is built using the Swift SDK for Android and is available in the Google Play Store is Skip Showcase: https://github.com/skiptools/skipapp-showcase/

(disclaimer: I work on the Skip.tools product)

samtheprogram10 hours ago
Not yet, and possibly not ever quite from Xcode. But using Swift CLI tools, yes.

The example Activty I saw is pretty rough ergonomically, but I have no doubt an ergonomic, SwiftUI-like library could be built on top of what’s currently there and/or on the roadmap.

brookst10 hours ago
No, it’s just an Android compiler and standard libraries.

Same way there are C compilers for Windows and Linux, but that does not mean binary compatibility.

crossroadsguy6 hours ago
Sharing the “business logic” pretty wasn’t the problem — at least not of late. Writing UI on both was the pain, or the existing shared UI solutions. As a mobile dev I’d rather appreciate a common UI framework that doesn’t suck like react native.
tcoff915 hours ago
When was the last time you tried react native? It’s pretty good now that they finally completed the transition to the New Architecture. With Expo it’s pretty nice these days.
danielcspaiva51 minutes ago
Rip flutter
a3w9 hours ago
The example shows non-GUI code written in Swift, with Kotlin for frontend. So, still no UI in Swift?

What does it add to the linked "swift-java project" then at all, perhaps some lifetime events and a sort of batteries-included standard library?

VWWHFSfQ10 hours ago
I think people will get excited about this and then quickly realize how painful it is to code in a foreign environment from the platform.

How miserable it would be trying to write Java or kotlin targeting iOS apps. I think this will be the same.

Just use the native tools and languages for the platform. Swift/Objc/xcode for iOS. Java/Kotlin/Android Studio for Android.

You will be so much happier.

AnthonyMouse10 hours ago
This depends entirely on how well the thing you're using bothered to support multiple platforms.

Browsers are pretty much the gold standard here, ironically. You might have to care if it's Firefox or Chrome but it's very rare for you to have to care if it's Firefox on Windows or Mac or Linux. It's exactly why React is simultaneously horrible and everywhere.

So it can be done, it's just a question of whether that framework has done it well, ideally while also doing other things well (unlike React).

morshu90017 hours ago
idk about Android, but native iPhone dev is pure torture. Hence React Native.
tcoff915 hours ago
Android is way worse. iOS has way better APIs.

Android studio is way better than XCode though

cosmic_cheese4 hours ago
Agreed on SDKs/APIs. Compose improved the Android situation but it’s still a mess compared to UIKit.

I’m more mixed on Android Studio. It’s fine I guess, but I wish its UI were more deeply customizable. Many of its design decisions irritate me.

tcoff912 hours ago
Xcode is dogshit though…

I’m mostly in Neovim writing typescript (react native) luckily.

cosmic_cheese2 hours ago
I've not had much trouble with Xcode in the past 15+ years I've been using it. Its biggest warts involve Interface Builder, which is easily avoidable by using code for UI instead of XIBs or storyboards.

With Android Studio, I'd say the ways that it being an IntelliJ IDE puts it above Xcode are cancelled out by other aspects of Android development, which can be abysmal. Swift Package Manager and Clang/llvm code stripping have never made me want to tear my hair out the way that Gradle and Proguard have for example.

tcoff9150 minutes ago
Gradle is the single most confusing build system tool of all time. It’s so bad.

I agree that other than JetBrains everything else about it sucks ass.

oblio9 hours ago
> How miserable it would be trying to write Java or kotlin targeting iOS apps. I think this will be the same.

What happens in the Java/Kotlin case?

featherless9 hours ago
Does this result in the Swift code being compiled or transpiled?
mk8941 minutes ago
It's compiled.

From what I see in other threads, skip.tools offers the possibility to transpile SwiftUi to Compose, so you build one UI and port it to android too.

Here we're talking about sharing the code logic (written in swift) and write android UI that uses it.

bingobangobungo10 hours ago
Why cant everyone just get along and allow for KMP to work all within Android Studio instead of XCode. I'm working with this stuff everyday and that is by far my biggest headache.
jajuuka10 hours ago
Same reason everyone doesn't use Xamarin. Everyone has their own multiplatform framework solution.
wiseowise9 hours ago
JetBrains already works on Swift support within Android Studio.
saubeidl9 hours ago
This looks not bad, but why would anyone use this in a world where Kotlin Multiplatform exists?
akmarinov1 hour ago
Pretty much everything starts iOS first, so why bother with KMP when this exists?
cosmic_cheese8 hours ago
Because some of us prefer writing Swift over writing Kotlin.
wahnfrieden10 hours ago
Related: https://skip.tools <-- SwiftUI for Android
bigyabai10 hours ago
> Over 25% of packages in the Swift Package Index already build for Android

That's... not encouraging.

joanniso10 hours ago
I'm pretty happy with that number, considering this ecosystem is _brand new_. This is the lowest it'll be.
tomovo10 hours ago
Yes and any package dealing with UI is automatically disqualified, so 25% really is pretty good.
tclancy10 hours ago
If you compare it to absolute zero I think you may be pleasantly surprised.
mr7uca9 hours ago
Sweet, now I can make a cursed android app with views written in switft that use kotlin viewmodels
user39393829 hours ago
Whole modern stack is upside down this is a waste of talent
colesantiago10 hours ago
What does this mean for React Native?

Is Swift now going to be the de facto language for Mobile (and maybe Desktop) development?

akmarinov10 hours ago
Not a chance

React Native is popular because there’s a thousand times more React devs than native devs.

And people like to use what they know.

Also React dev experience makes anything Swift related look like stone age technology

Austin_Conlon10 hours ago
> Also React dev experience makes anything Swift related look like stone age technology

How so?

akmarinov2 hours ago
- Hot reload that actually works.

- OTA updates, skipping Apple review for every little thing. Really speeds up builds too.

- Repack and module federation aren’t even possible on native

- running tests on iOS - 2 minutes minimum and having to boot the simulator in most cases. RN - seconds

- IDE with all sorts of plugins, that are impossible on Xcode, Rozenite

- AI trained on lots more React code, where they usually struggle to use Swift 6 properly

and a bunch more things

jshier9 hours ago
Presumably hot reload and IDE integrations that actually work. Xcode is really crappy compared to other IDEs, so platforms that can avoid it for most of your work tend to be an advantage. Xcode 26 generally broke anything that relies on indexing, like autocomplete, edit in scope, or refactoring, among others.
hoppp10 hours ago
The npm ecosystem is one of the worst and most backwards places to be, so I don't think so.
Larrikin10 hours ago
I assume all the extra work you have to do to make it work instead of using the native language.

If the project is simple to port over then it should have just been a website.

wiseowise9 hours ago
Why would a marginal platform language become de facto language for mobile? If anything, Kotlin is much better positioned to fill the niche. It is already far, far ahead of anything Swift has to offer and is backed by a company actually making money out of the tools. What incentive does Apple have? My bet is expanding Apple services (Apple TV, Music, etc.), but is that enough for Apple to create a proper dev ecosystem? Highly unlikely.
GZGavinZhao10 hours ago
Flutter still exists, so as a competitor you need to beat both React Native and Flutter.
p2detar10 hours ago
I last used RN half a decade ago, but from what I see around me - our frontend developer, who is proficient in React, actually chose to use Flutter for our iOS and Android mobile apps — and he’s quite satisfied with it.
kelvinjps1010 hours ago
Kotlin did it first with kotlin multiplatform
hatmanstack9 hours ago
The Simpsons did it.
danielfalbo10 hours ago
Why can’t everything just be a progressive web app
dagmx6 hours ago
Because hardware capabilities exist outside the realm of web technologies.
ripped_britches7 hours ago
Apple and Google couldn’t take 15-30% that way
kylecazar10 hours ago
Because Google/Apple don't want us to circumvent their respective app stores, so they make certain features/API's a PITA (if not impossible) to use unless you are building natively.
timeon9 hours ago
Meanwhile I considered PWAs necessary evil on iOS. I would gladly use native tools but paying developer subscription just to install private/personal apps is no-go.
throw_m2393399 hours ago
Most people don't even know they exist (I do not count webapps in a native shell as PWA). that's the biggest issue with PWA in my experience. People aren't using them.