How to use a variable in @available(macOS ver, *)
No way.
I do not want to hard code like this
Then you cannot use
@available in your app.
Some attributes might get more useful if you can use variables in them.
But I do not think
@available can be a good example. When you write some code which needs
@available, it is strongly dependent on a specific version. Hiding such info useing variables would not be a good abstraction.
If you want to hear opinions from more developers, you should better visit
https://forums.swift.org .