2016年10月23日
摘要: E文:https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Generics.html associatedtype用于protocol中 assoc 阅读全文
posted @ 2016-10-23 13:52 雨过平静 阅读(3591) 评论(0) 推荐(0) 编辑
摘要: 本文转载自:http://blog.csdn.net/sinat_27706697/article/details/47122137 感谢作者:秋恨雪 通常情况下,我们在使用数组(Array)或字典(Dictionary)时会使用到下标。其实在Swift中,我们还可以给类、结构、枚举等自定义下标(s 阅读全文
posted @ 2016-10-23 12:34 雨过平静 阅读(3018) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.jianshu.com/p/14cc9d30770a 感谢作者:此ID想了很久 Swift中protocol的功能比OC中强大很多,不仅能再class中实现,同时也适用于struct、enum。使用 mutating 关键字修饰方法是为了能在该方法中修改 struct 阅读全文
posted @ 2016-10-23 12:13 雨过平静 阅读(2549) 评论(0) 推荐(0) 编辑