I'm trying to set a class constant depending on the current running macOS version.
class MyClass {
// only when macOS 10.15
let constant = 1
// only when macOS 11
let constant = 2
}
@available only capsules classes or functions while #if only works on compile time and if #available(macOS 11.0, *) works only inside functions.
Is there a way to realise this without defining the constant as a variable and set it in the init of the class?