API availability - RaduG/swift_learning GitHub Wiki
if #available(iOS 10, macOS 10.12, *) {
// Use iOS 10 APIs on iOS, and use macOS 10.12 APIs on macOS
} else {
// Fall back to earlier iOS and macOS APIs
}
The * is required and means that on any other platform the condition is true if it executes on the minimum deployment target.