Objective-C has an @available expression in XCode 9+ / LLVM 5+ that allows you to guard a block of code to at least a certain OS version so that it won\'t emit unguarded ava
BOOL doit = FALSE;
if (@available(iOS 11.0, *)) {
if (some_condition) {
doit = TRUE;
}
}
if (doit) {
// code to run when on iOS 11+ and some_condition is true
} else {
// code to run when on older iOS or some_condition is false
}