Type Safely

Type Safely

Share this post

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

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

Share this post

Type Safely
Type Safely
Check The Current Platform and Version More Easily Than Using #available
Share
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 …

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share