weak self

70: Swift Runtime 之 Method Dispatch—Static, Table, or Message


Listen Later

{ 完整節目筆記 https://weakself.dev/episodes/70 } 波肥來介紹 Swift 的 method dispatch。 👋開場 ⏪上集節目回顧 聽眾 dan12411 貢獻他的 Xcode 技巧。 📰一週開發者新聞 🧪Xcode 12.5 beta 3 & iOS 14.5 beta 3 ⏬XcodesApp 🥰工程師幹話—工程師應該要放心大膽的不寫文件 🧩Flutter 2 is here ⭐️Swift Runtime 1—Method Dispatch in Swift/ObjC: Static, Table, Message Dispatch struct 的 func 一定是 static dispatch。因為 optimization 設定的不同,有可能會是 inline class 的 func 通常是 table dispatch。如果加了 final 或是在 extension 定義新 func 就會是 static。 Swift 裡的NSObject subclass,一般 func 也是 table dispatch,即使加了 @objc 也一樣。若是 @objc dynamic就會是 message dispatch。如果加了 final 就會是 static 想要自行研究的話,可以用以下方法(程式碼請見完整節目筆記) 用 swiftc -emit-silgen Foo.swift -Onone 即可得到 SIL 💸勸敗話題 13 的開發者週報 歡迎大家來貼職缺或求職作品 小小夢魘2 👋收尾 更多 weak self 聽眾信箱 [email protected] 官網 https://weakself.dev 主持人 一三波肥喬喬 Twitter @weak_self 提問箱 贊助 weak self



This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit weakself.substack.com
...more
View all episodesView all episodes
Download on the App Store

weak selfBy 一三、波肥、喬喬

  • 4.9
  • 4.9
  • 4.9
  • 4.9
  • 4.9

4.9

10 ratings