I want to declare some variables at the beginning of a class and have their values be modified later and elsewhere. I'd rather not assign an initial garbage value to these to keep things concise.
Can I declare variables of basic types by declaring them as instances of the type? An example of what I mean is this:
class foo() {
var isCool = Bool()
var someInteger = Int()
func gotTheFunc() -> Bool {
isCool = true
return isCool
}
}
The compiler lets me do this, but is it something I actually can / should do when declaring class properties like this?
Thanks!