~/talk

Global Variable Oriented Programming

Talkat iOS Conf SG 2020 · on Thursday, 2020-01-30· [swift]
slides:none on file

Walks through a concrete re‑implementation of SwiftUI’s environment for UIKit: uses Combine (ObservableObject + @Published), an @propertyWrapper global<T> that reads a registered instance from a singleton Environment, and runtime reflection to discover wrapped properties. Key implementation details: store AnyCancellable sinks, post filtered NotificationCenter updates on the main queue, and solve generic covariance via an AnyGlobal protocol. Demo app has three tabs; toggling a value updates all views instantly, showing the approach works but needs careful notification filtering.

AI-written summary · about

  1. 0:00Introduction
  2. 4:03Singletons
  3. 6:18Environment Singletons
  4. 8:02Swift UI
  5. 11:40Swift UI Environment
  6. 12:19App Overview
  7. 14:13Publishing Changes
  8. 15:22Environment Singleton
  9. 19:17Handle Updates
  10. 22:18Global Properties
  11. 25:10Reflection
  12. 29:46Covariance
  13. 33:09Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.