摘要: ?? 对nil进行条件判断 阅读全文
posted @ 2018-02-22 18:20 ShellHan 阅读(110) 评论(0) 推荐(0) 编辑
摘要: class 太长不看版: Delegate关系 1. 子类的 designated init 必须调用父类的 designated init, 并且属于子类但是不属于父类的属性要在super.init()前赋值 2. 子类的 designated init 不能调用父类的 convenience i 阅读全文
posted @ 2018-02-22 17:58 ShellHan 阅读(146) 评论(0) 推荐(0) 编辑
摘要: OC版 // classA.h @property (nonatomic, copy) NSString *testString; //classA.m - (NSString*)testString { if (!_testString) { _testString = @"Hello"; NSL 阅读全文
posted @ 2018-02-22 16:06 ShellHan 阅读(174) 评论(0) 推荐(0) 编辑
摘要: https://www.weheartswift.com/closures/ Currying 柯里化 e.g.1 //返回值为 参数为Int返回值为Int的闭包 func addTo(adder: Int) -> Int -> Int { return { num in return num + 阅读全文
posted @ 2018-02-22 15:27 ShellHan 阅读(143) 评论(0) 推荐(0) 编辑