Is SwiftUI backwards compatible with iOS 12 and below?

Is SwiftUI backwards compatible with iOS 12 and below? Or will it be eventually?

I still have lots of users using iOS 11 and 10.

Replies

I think no because all library already annotation for iOS 13 or higher. For now I only see advantage for use in watchOS.

SwiftUI will require Swift 5.1+, so unless they back-port both it and Swift to the current releases, *and* come up with creative fixes to module stability with Swift 5.0, I'd say no.


The unfortunate side-effect with ABI stability in Swift 5 is that the system isn't just exposing the swift libraries, but depending on a particular version for its own use. Module stability (being able to compile against binaries compiled with a different Swift version) is also only coming in Swift 5.1, which means that you still can't link against a library (system or third party) compiled with Swift 5.0 or earlier. So replacing the Swift version in current releases with 5.1 could be a big, breaking change.

I would really like to hear an official statement on backward compatibility for SwiftUI from Apple. The library annotations make me think I won't like what their position will be, but I need some closure on this issue. Personally, I am looking ahead to revamping some UI code so my app will pass the fully size adaptive requirement for App Store acceptance that will be in force in April. And I need to know, is there any hope that I can use SwiftUI for it?

You could drop support for iOS 12 for your new app and go iOS 13-only. I believe you can set things up such that anyone on iOS 12 will still see the old app.

I wouldn't be able to fix any bugs on my old release, or add new features from that point forward. Since not all iOS 12 devices will be getting iOS 13, that leaves a certain percentage of my users behind. I was only able to stop supporting iOS 9 fairly recently, because of that reason.

This isn't actually about module stability, though. In spite of its name, SwiftUI isn't part of Swift (though the syntax used to declare Views in SwiftUI is part of Swift 5.1+). The functions in the SwiftUI are just new Apple APIs.


Like always, these are only going to be available on existing OS releases if Apple makes new dot (minor) versions. That can make new API available for users who update to a new dot version, without a major version upgrade. That *can* happen, but it usually doesn't.


(Actually, some APIs turn out to backwards compatible because they *existed* in older versions of the OS, but weren't *public*. But this doesn't happen very often.)


IDK, but it seems to me that *new* apps using SwiftUI are going to start appearing much sooner than *revisions* of existing apps with SwiftUI. That's because the cost of conversion is likely pretty high, and perhaps not worth paying for code that is already working. (And it's probably easier to generalize the layout of your existing app than to adapt it to SwiftUI. But that's just speculation.)

I think this reply from Quinn “The Eskimo!” on another thread applies here:

I wanted to know if our company does not move up its base SDK to iOS 13 just yet in order to support customers on older versions, can we still move the app to Swift 5.1?

You seems to be confused here. Let’s start with some facts:

Thus, to use Swift 5.1 you must use Xcode 11 which means you must use the iOS 13 SDK. However, this does not stop you supporting iOS 12. The oldest iOS version supported by your app is determined by the iOS deployment target, which you can set as suits your product.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"


From: https://forums.developer.apple.com/message/364021#364021

Those are all things I can do, namely switch to Xcode 11 and Swift 5.1, and use the iOS 13 SDK. However, if the iOS 13 annotations referred to by denisoliveira are still there, then I would not be able to build for iOS 11 or 12 without having alternate UI. It is possible I could keep my current UI for the lower OSes, and just develop the new interface for iOS 13, but Apple could kick the app from the App Store in April, since I would not be fully size adaptive for the lower OS versions. It's a matter of interpretation of the new requirement, and I don't know which way Apple will decide.


It's analgous to the introduction of safe areas. Those were ported so that they could be used for iOS 9 and up, even though they were introduced in the iOS 11 SDK. With the annotations restricting SwiftUI to only iOS 13, the indications are that the same treatment will not or cannot be applied to the introduction of SwiftUI. I have some dim hope that in a future beta release the annotations will be changed to include iOS 12, or dare I hope, iOS 11. I have been unable to find a statement from Apple either way, so I'm hoping to get one here, eventually.

>don't know which way Apple will decide.

>I have been unable to find a statement from Apple either way, so I'm hoping to get one here, eventually.


Keep in mind, if you're asking about the review process...no one here can speak for review, and review isn't here.Beyond exchanging opinions/anecdotes, you'll need to wait like the rest of us 😉

New features can be added to the new app. I think at some point we all are going to be faced with the question of remaining locked in the past with an existing code base or cutting free.


At some point early this fall, Apple will have dropped iOS 13 and a month or so later we'll be past the 50% adoption mark.


So another question, perhaps more relevant, might be whether or not the majority of your customers are better served with the ability to rapidly add new features and expand on existing ones... or do without, but be able to get bug fixes?

As long as SwiftUI remains annotated to iOS 13 only, there is no incentive for app developers to:

- Mix in SwiftUI views with existing apps

- Beta test new SwiftUI apps that can only be distributed by TestFlight to users that install iOS 13 public beta

- Use SwiftUI at all if a new app's intended audience must include older iOS devices (such as banking apps)


I can understand the reasoning why SwiftUI is currently iOS 13 only, but I do not understand why there is not even a statement of intent that this will change in the upcoming months. The only hint might be that there were demonstrations at WWDC of how SwiftUI can coexist with apps that have existing storyboards. Forward compatibility alone is not good enough. SwiftUI will be adopted by the developer community much more rapidly if and when it is announced to be backward compatible.

That’s something that always drives me crazy about WWDC videos. They almost never even mention the entire concept of backwards compatibility. I’d like to be able to release updates to take advantage of all the shiny new APIs on launch day, but I live in the real world, as I suspect most of us do. I can’t penalize my users just because they have an iPhone 6 or because they don’t update to the latest iOS version within 5 minutes of release.


It really wouldn’t kill them to add a couple of sentences about whether things will be back ported and what to do with newly deprecated APIs when we still have to support older OS versions. Normally they don’t even bother telling us what the lowest deployment target is for new Xcode versions. Not like anyone would ever want to know that... 🙄

I'm extremely disappointed since I learned that SwiftUI is available from iOS13 only!

This is ridiculous! I have many application that I'd like to renew, robust with this new programming structure but now I realise this will not happen. Sad.

By disabling some iOS13 related properties e.g. color themes, sf icons and such they should allow us to compile SwiftUI for at least iOS10

If they want to make Swift / SwiftUI best prog.lang. they have to consider this.

Ever WWDC opening is starting with their billions of dollars budget information etc. so hire some developers for backward compatibility.

Regards