1.在沒有子類別的class 上使用final關鍵字

2.打開Swift "Whole module optimization" in project build settings

3.使用Value types 的struct、enum 搭配 protocol、extension 及協議導向 取代Reference types的 class

 

參考資料:

WWDC 2015 Optimizing Swift Performance

WWDC 2015 Protocol-Oriented Programming in Swift

WWDC 2015 Building Better Apps with Value Types in Swift

WWDC 2016 Protocol and Value Oriented Programming in UIKit Apps

WWDC 2016 Understanding Swift Performance

https://www.raywenderlich.com/112027/reference-value-types-in-swift-part-1

 

arrow
arrow
    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()