@backDeployed feature is available with Swift 5.8 🚀

Alkin Cakiralar
2 min readMar 31, 2023

--

As you know, SwiftUI evolves every new year with new features. However, a lot of new features may not compatible with old versions of os versions. Therefore we need to wait to upgrade the app’s os version for a few years to use those features or we need to divide our codes checking availability according to the os version by functions. With @backDeployed helps us to make functions to compatible with old os versions.

Let’s take a look at how it is working

For example, we have a function that helps us calculate BMI and set this function only available with iOS 16.

And if we support older iOS 16 for our app we should check the availability of the os version when we want to use it as below.

Let’s make “calculateBMI” function to available with older versions of iOS 16 and use it.

See! It’s so simple and useful. With this attribute, we can get through it our concerns about users who are using old versions.

I hope we will able to use the new SwiftUI components with older versions of os with this attribute.

If you want more click the link below

https://github.com/apple/swift-evolution/blob/main/proposals/0376-function-back-deployment.md

--

--