随笔分类 -  Swift

Swift 实现单例模式Singleton pattern的三种方法
摘要:转自:点击打开链接From my short experience with Swift there are three approaches to implement the Singleton pattern that support lazy initialization and thread... 阅读全文

posted @ 2015-07-02 11:27 Hai_阔天空 阅读(217) 评论(0) 推荐(0)

Swift之 ? 和 !
摘要:04 June 2014Swift语言使用var定义变量,但和别的语言不同,Swift里不会自动给变量赋初始值,也就是说变量不会有默认值,所以要求使用变量之前必须要对其初始化。如果在使用变量之前不进行初始化就会报错:var stringValue : String //error: variable... 阅读全文

posted @ 2015-04-21 13:31 Hai_阔天空 阅读(175) 评论(0) 推荐(0)

导航