I need to initialize a variable depending on the OS version. I'm trying to use #available inside a `struct. I need to initialize a variable at the time of declaration.
Here is my code that I tried,
struct ColorConstants {
static var os = 0
#available(iOS 9, *)
os = 9
#available(iOS 10, *)
os = 10
}
It gives me a build error:
Expected declaration