Live data from Hacker News

The Swift SDK for Android

swift.org

1–10 of 298 posts

Re: The Swift SDK for Android

#2
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?

Re: The Swift SDK for Android

#4
post #2

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?

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.

Re: The Swift SDK for Android

#5
post #2

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?

> 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

Re: The Swift SDK for Android

#7
post #2

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?

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.

Re: The Swift SDK for Android

#8
post #2

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?

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.

Re: The Swift SDK for Android

#10
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.

Post reply on HN