WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Optimizing your app

Forums > iOS

Ok guys, when you have an app that you've designed to run on iOS 14 or later. What does it mean to optimize the app. I have over the last few years seen a few of the apps I use say they are optimizing for iOS **. So Im just curious on what does that mean. Sorry for the very newbie question.


This is a great question!

Please watch Paul's recent video Hiding The Keyboard.

In this video Paul discusses a problem with hiding a numeric keyboard after entering a dollar amount.

This was solvable with older versions of iOS. But, indeed, it was a pain.

With recent updates to iOS, the Swift language received a new state variable named @FocusState. This gracefully solves the keyboard problem in a very Swifty (declarative!) way.

So, if a developer says they are optimizing for iOS 15, one thing they might be doing is stripping their application of the previous keyboard hiding hacks, and implementing a more elegant @FocusState based solution.

In this case the optimization may not make the application any faster. (This is a common understanding of optimization.) But it will certainly make the application easier for the developer to maintain and improve.


Thanks, @Oblelix, Sorry, I have been off the grid for a bit dealing with some health issues and other things. I do appreciate this explanation. So, my next question is this. Lets say you have an app that was made to run on iOS14 but you want to take advatage of some of the new things in iOS15. For example the .searchable. How does one go about keeping the custom searchbar you had in iOS 14 but allow the app to use .searchable if the user is on iOS15 or later?


Another Swift developer you'll want to follow, Antoine van der Lee, has a great article on this....

How to use the #available attribute in Swift

To be honest, though, I have not tried this technique. One of my pandemic goals was to learn Swift and publish an app on the App Store. So, for now, my goal is just to get something working! If I can convince more than a handful of friends and my mum to download it, I'll start thinking about folks on older devices!

Post here! Let us all know how this works for you and what caused you the most grief. (So we can learn from you!)


Save 50% in my Black Friday sale.

SAVE 50% To celebrate WWDC22, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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

Reply to this topic…

You need to create an account or log in to reply.

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.