
swift
文章平均质量分 84
DS攻城狮
这个作者很懒,什么都没留下…
展开
-
swift单例
SwiftSingleton tl;dr: Use the class constant approach if you are using Swift 1.2 or above and the nested structapproach if you need to support earlier versions. An exploration of the Singleton p转载 2015-07-20 11:25:30 · 413 阅读 · 0 评论 -
Swift之 ? 和 !用法
转自代码手工艺人 Swift语言使用var定义变量,但和别的语言不同,Swift里不会自动给变量赋初始值,也就是说变量不会有默认值,所以要求使用变量之前必须要对其初始化。如果在使用变量之前不进行初始化就会报错: var stringValue : String //error: variable 'stringValue' used before being init转载 2015-07-23 10:40:50 · 664 阅读 · 0 评论