Member-only story

Checking API Availability in Swift

Check you can use it, ok?

Steven Curtis
4 min readApr 27, 2020
Photo by Keagan Henman on Unsplash

Developing against an Operating System means that you might be limited in the features of Swift or the SDK that you can use.

What can you possibly do then?

This article will explain a solution.

Difficulty: Beginner | Easy | Normal | Challenging

Prerequisites:

  • Coding in Swift Playgrounds (guide HERE)

Terminology

API: Application programming interface. A set of accessible tools for building software applications

API Availability

Here we are talking about attributes to allow you to support multiple versions of iOS with ease.

To help you do this, Swift provides availability attributes. We shall explore how these work, and how they can be implemented into your own code to make a great coding experience for your colleagues, and a great App experience for your users.

Functions with a Minimum iOS Version

You might design your API for your client to use (perhaps in a framework, or similar).

When you want to remove an old function you can’t just remove it. Perhaps there are…

--

--

No responses yet