a macro to denote the availability of an Objective-C API.
- Swift Standard Library
In Swift, you use the
@available attribute to control whether a declaration is available to use when building an app for a particular target platform. Similarly, you use the availability condition
#available to execute code conditionally based on required platform and version conditions. Both kinds of availability specifier are also available in Objective-C.
API macro to add availability information in Objective-C:
This is equivalent to using the
@available attribute on a declaration in Swift:
@available() keyword to check availability information in a conditional statement in Objective-C:
This is equivalent to the following conditional in Swift: