Basically, Swift does not allow me to do this:
class stored properties not supported in classes did you mean 'static'.
class var hello = "hello"
However this is fine:
static var hi = "hi"
I know that the difference between Class and Static in Swift is that Class variables cannot store stored properties, while Static variables can. However, the fundamental difference between Class and Static variables is that static variables cannot be overridden in subclasses, while class variables can. This is a functionality that I wish to keep.
I know that a simple fix to this issue is to make this a computed property using a hacky fix like this:
class var Greeting : String {
return "Greeting"
}
This does solve the problem, and I hope it helps some people online as well. However, I would like to know if anyone knows why Swift behaves this way, and does not allow for stored properties in class level variables.