Swift Evolution: Unavailability Condition
Nov 16, 2020
In some cases, we need the negative of any conditions. At this point, if I describe that case as a basic instance;
if #available(iOS 13, *) {} else {
someOldStuff()
}
In this specific case, we don’t want that. The positive case is unnecessary and impairs code readability.
Swift’s new feature: Unavailability Condition
if #unavailable(iOS 13, *) {
someOldStuff()
}
Take a look at the negative availability.
https://github.com/apple/swift-evolution/blob/main/proposals/0290-negative-availability.md