Inter view - result0924/iosLearning GitHub Wiki

Struct vs Class

Inheritance vs Interfaces (Protocols) In Swift

繼承
1. 難以debug、因為一層一層繼承下去不知道前面的類別做了什麼事
2. 不支援struct
3. 支援objective c

組合(use protocol)的優點
1. struct / enum 可以使用。(value types have a lot of benefits like performance and memory safety)
2. Composition has the benefit of using value types and often results in better reusable code.

iOS 面試大全

Code Review

Refer