The recent @available addition to Objective-C can be handy but is apparently quite short-sighted..
Any app being around for more than a couple weeks will need to target e.g. multiple macOS versions.
Unfortunately the only @available construct for explicitly targeting older OS releases that appears to work (as of Xcode up to and including 12) is this cumbersome
if (@available(macOS 11.0, *))
{
// all hunky-dory: no-op
}
else
{
// legacy work arounds
...
...
}
Using just the else branch with a negation emits the dreaded @available does not guard availability here compiler warning..
Is there any way to simplify this ghastly code and remove the dummy no-op branch?