UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Alert Deprecation in iOS 15+

Forums > SwiftUI

Just wondering what everyone's thoughts are on Alert and, from what I cans see, any form of alert modifier before iOS 15 becoming deprecated.

I'm a little disappointed since the new form of alert - alert(:isPresented:presenting:actions:message:) is only available iOS 15+.

I'm assuming the best way to handle this is to check for os version and include both styles of alerts, one for < iOS 15, and one for >= iOS 15.

I really wish Apple would have just introduced a new alert modifier and not deprecated the rest so soon. I really did like alert(item:content:) and used it everywhere.

4      

Firstly depands what the target for your app is! eg iOS 14. and the old .alert will work fine on iOS 15 (and not give a warning error at the moment), therefore it safe to keep in your code for now, however this is warning you to use the new .alert if your min iOS target is above 15. I would not over worry until you move your app to min iOS 15 then change the alerts, however future release it will give a warning that it completely deprecated when you build your code.

3      

Thanks, I'm not running the Beta right now, so I don't even have the new alert style available.

My background is mostly C#, Python, and Java, so I wasn't quite sure what deprecation meant in regards to the App store approval process.

Since I am still on Big Sur, I might just create my own alert view modifier and just plug the new alert style in when it is available to me. That way I won't need to make changes all over the place...

Thanks again for the tips in regards to what 'deprecated' means in Apple terms.

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.