Skip to content
Programing

Swift 6.3: Breaking the Apple Barrier with Android Support and Strict Concurrency

Published: Duration: 6:27
0:00 0:00

Transcript

Host: Alex Chan Guest: Marcus Thorne (Senior Mobile Architect and Cross-Platform Specialist) Host: Hey everyone, welcome back to Allur. I’m your host, Alex Chan, and I am so glad you’re joining us today. Guest: Thanks, Alex! It’s great to be here. It’s a pretty wild time to be a Swift developer, isn’t it? Host: It really is. I mean, let’s dive right into the "big" one. Official Android support. When I saw the release notes on Swift.org, I actually did a double-take. We’ve had "community" support for Android for a while, but what does it *actually* mean now that it’s "official"? Guest: Right, so that’s the distinction people need to grab onto. Before 6.3, if you wanted to run Swift on Android, you were essentially using a labor of love from some very dedicated community members. But now, Android has graduated to a fully supported target in the Swift toolchain. That means it’s part of the official CI—the continuous integration and testing. Every time the Swift team makes a change, it has to pass on Android too. No more "oh, this works on my Mac but breaks on a Pixel." It’s stable. Host: So, if I’m an engineering manager, I can actually tell my team, "Hey, we can write our networking layer in Swift and it’ll just... work on Android?" Guest: Exactly. And the best part is the performance. Unlike, say, React Native or even Flutter to an extent, Swift compiles directly to native machine code. It’s leveraging LLVM, just like it does on iOS. So you’re getting C++ levels of performance on Android without the overhead of a virtual machine or the Java Native Interface—the JNI—for your core logic. It’s essentially bypassing the heavy lifting that usually slows down cross-platform bridges. Host: Interesting! I think a lot of people assume "cross-platform" always means "slower." But you’re saying that because Swift doesn't have a heavy runtime or a garbage collector, it’s actually a better fit for Android heavy-lifting than some of the native options? Guest: (Laughs) Well, don’t tell the Kotlin devs I said that! But yeah, for things like image processing, complex data serialization, or heavy computational math, Swift is a beast. You still use Kotlin for your UI—that’s the right way to do it—but you link your Swift code through the Android NDK. It’s a seamless bridge now. I’ve been using it for a shared domain model recently, and the parity between the two platforms is just... it’s a breath of fresh air. Host: Okay, so that’s the "expansion" side of things. But there’s also the "enforcement" side. Swift 6.3 isn’t just letting us go to new places; it’s changing how we behave once we’re there. Let’s talk about the Strict Concurrency mandate. I’ve heard some devs are... well, they’re a bit stressed about it. Guest: Oh, "stressed" is putting it lightly, Alex. It’s a total paradigm shift. Up until now, data-race safety was kind of a suggestion. You’d get these experimental flags, maybe some warnings. In 6.3, the compiler is basically saying, "The party's over." Data-race safety is now a requirement. Host: Right, and for those who maybe haven’t hit this in their day-to-day yet, a data race is when two threads try to touch the same memory at once, and everything goes boom, right? Guest: Exactly. It’s those "Heisenbugs" that only happen to one user in a thousand, and you can never reproduce them in the lab. Swift 6.3 wants to kill those forever. It does this by tracking "isolation" at compile-time. If you try to pass something that isn't thread-safe across a boundary—say, from a background task to the main thread—the compiler won't even let you build the app. It just stops you. Host: That sounds... frustrating but also kind of amazing? It’s like having a senior engineer looking over your shoulder 24/7. Guest: It really is. And the "gatekeeper" for all of this is the `Sendable` protocol. I’ve spent a lot of time recently marking my structs as `Sendable`. It’s a semantic guarantee. You’re telling the compiler, "I promise this data is safe to move around." If it’s a simple struct with a UUID and a String, the compiler says, "Cool, go ahead." But if you try to sneak a non-thread-safe class in there? No way. Host: I saw an example in the docs about using Actors to manage state. Is that the "new normal" for 6.3? Guest: Definitely. Actors are the stars here. Think of an Actor as a safe box for your data. Only one task can be inside that box at a time. So, if you have an `InventoryManager`—like in the example I was looking at earlier—you can’t just reach in and change the `stockCount` from some random thread. You have to use `await`. The compiler forces that disciplined flow. It’s brilliant because it removes the need for manual mutexes or locks, which are just... ugh, they’re so easy to mess up. Host: I can imagine. But Marcus, let’s be real—what about the legacy code? I’m thinking of all those massive apps out there with thousands of lines of old Swift. Is migrating to 6.3 going to be a nightmare? Guest: I won’t lie to you—it’s a hurdle. It’s what I call a "growing pain" for the ecosystem. If you open a 5-year-old project in 6.3, you might see a wall of red. But the Swift Package Manager and Xcode have actually included some pretty decent incremental migration tools. My advice? Don’t try to fix the whole app at once. Address the warnings one module at a time. It’s a small price to pay for the stability you get at the end. Once you’re "Sendable-compliant," the crashes in your app just... they drop significantly. Host: That’s a huge selling point. I mean, we’ve all been there, chasing a crash that makes no sense. If the compiler can catch that before it even reaches a device? That’s a win for everyone. Guest: Exactly. And when you combine that safety with the Android support, you’re looking at what I call "Native Cross-Platform." You’re not compromising on performance, and you’re not compromising on safety. You’re writing high-performance, data-race-free code that runs on an iPhone, a high-end Android flagship, and even your backend server. It’s a unified roadmap. Host: It feels like Swift is finally growing up and leaving home. It’s not just "the Apple language" anymore. It’s a general-purpose systems language that’s actually... dare I say, fun to use? Guest: (Laughs) Exactly. It’s safe, it’s fast, and now, it’s everywhere. Host: Marcus, this has been so enlightening. Before we wrap up, what’s one piece of advice you’d give to a developer who’s about to hit "update" to Swift 6.3 for the first time? Guest: Honestly? Be patient with the compiler. It’s not being mean; it’s being protective. When it gives you a concurrency error, don’t just try to silence it with a hack. Take five minutes to understand *why* it thinks your data isn't safe. Once you "get" the mental model of isolation and Actors, you’ll find you’re actually a much better architect than you were before. Host: "It’s not being mean; it’s being protective." I love that. Words to live by in the dev world! Marcus, thank you so much for joining us and breaking this down. Where can people find you or follow your work? Guest: You can find me on GitHub or Twitter—or X, I guess—at MThorneDev. I’m usually posting about Swift performance and whatever weird Android bugs I’m currently squashing. Host: Awesome. Well, that’s our show for today. Swift 6.3 is officially here, and whether you’re excited about Android or terrified of strict concurrency, there’s no denying it’s a massive step forward for all of us. If you want to dive deeper, check out the release notes on Swift.org or head over to our show notes at Allur.tech for some helpful migration guides.

Tags

mobile development ios performance android swift compiler concurrency