Type Safely

Type Safely

Check The Current Platform and Version More Easily Than Using #available

Daily Coding Tip 170

Millie Sturgeon's avatar
Millie Sturgeon
Sep 10, 2022
∙ Paid
pile of smartphones
Photo by Hal Gatewood on Unsplash

When I started to play around with if #available I realised that you will only ever get a false value if you are checking the current platform.

In other words, macOS apps will say that iOS 17 is available. It’s not just multiplatform apps that work this way either, even Mac specific apps that couldn’t possibly run on iOS …

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture