Lazy loading Properties in swift

I think a lazy property initialized with a closure would work:

lazy var myLabel: UILabel = {
    var temporaryLabel: UILabel = UILabel()
    ...
    return temporaryLabel
}()

As I read “The Swift Programming Language.” (Checkerboard example) the closure is only evaluated once).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)