2015-03-06 swift lazy initialization swift ios 12345678910111213141516171819// {#code#}() 是执行闭包函数lazy var someView: UIView = { var result = UIView()//do something return result}()// lazy 是延迟加载的关键字,也可以直接用lazy var someView: UIView = UIView()// 或者lazy var someView: UIView = SomeViewController.setupSomeView()static func setupSomeView() -> UIView { // setup someView return someView} < multiple targets building switch in swift >