FileWatcher
FileWatcher copied to clipboard
Optional variables as lazy?
Could we make the instance variable non-optional? Example:
lazy var someSize:CGSize = {
let x:CGFloat = 0
let y:CGFloat = 0
let size = CGSize(x,y,0,0)
return size
}()
//Now we can use someSize with out force unwrap 👌
//What happens is that the var isn't created until something asks for it.
print(someSize.x)