1swift核心是面相协议 不要使用子类
2协议语法
If a class has a superclass,list the superclass name before any protocols it adopts folowed by a comma:
class SomeClass: SomeSuperclass, FirstProtocol, AnotherProtocol{
//clsass definition goes here
}
。Swift的核心是面向协议编程
。面向协议的编程的核心是抽象(abstraction)和简化(simplicity)
。所以swift的核心就是抽象和简化
面向对象编程(object-oriented programmer) OOP
面向协议编程(protocol oriented programming) POP
http://www.cocoachina.com/swift/20150803/12881.html
3!?optional类型
喵神文章 swift类型https://onevcat.com/2014/06/walk-in-swift/
![
]
网友评论