1: Swift API 設計之 Value Type 與 Reference Type

weak self podcast

線上收聽與節目筆記

波肥想跟我們談談使用 Swift 時,介面設計的想法、觀念與小技巧。因為太長講不完,所以這集先討論 Value Type 與 Reference Type。

Swift 這門語言的明確性原則

大量使用 Value Type 的 Swift

  • 值還是引用?
  • Local Reasoning

Stack vs Heap

扯題:ABI 穩定

什麼場合要用 class

  1. 當你需要 retain count 以及 deinitialization 時
  2. 當你需要 shared 資料 (centrally held and shared, singleton)

    扯題:struct 可以有 singleton 嗎?

  3. 當 identity 不等同於 equality

Tagged Pointer 詳解(只適用於 iOS 12 之前的版本。iOS 12 有新的 Tagged Pointer 機制)

假使拿 struct 包 class

扯題:SwiftUI 用的 @propertyWrapper

更多 weak self


weak self podcast logo

weak self podcast

集結弱弱的我,也可以組成強大的社群。在 iOS 開發圈打滾的台灣工程師,專為 Apple & iOS 開發者而製作的 Podcast。主持人一三波肥。內容涵蓋了 iOS 與 Apple 開發圈的新知討論、踩坑經驗、人物採訪、社群活動、職場生活。

回首頁聽眾朋友怎麼說?weak self 歷史

線上收聽

可使用 OvercastListen NotesGoogle Podcasts 網站。

訂閱方式

weak self 支援任何 podcast 播放軟體,只要訂閱我們的 RSS 網址即可。

Listen on Apple Podcasts Listen on Google Podcasts Listen on Overcast Listen on Pocket Casts Listen on Spotify Listen in Castro

贊助 weak self

謝謝,請見說明