Scaling modern user interfaces is hard. GUI libraries simplify getting complex interfaces on the screen, but keeping UI state in sync with application state is a challenge, exacerbated by asynchronous state changes (e.g., network activity). Avoiding callback hell, while keeping the application modular, avoiding UI glitches, and preventing data loss can quickly turn into a nightmare.
This led to a plethora of software architectures, starting with the model-view-controller (MVC) and the model-view-update (MVU) architecture, exhibiting an object-oriented and a functional approach, respectively, with complementary strengths. MVC facilitates modularity, but handling of state and view updates is complex. Conversely, MVU simplifies state handling, but suffers from a lack of modularity.
Modern approaches (e.g., React, Flux & reacl-c) work towards reconciling these opposites. In particular, SwiftUI is a declarative UI framework leveraging functional programming in Swift, including immutable data types and embedded domain-specific languages. It is focused on native apps and has been shown to scale from apps for smart watches to desktop applications, providing a declarative MVU approach while retaining excellent modularity.
I will explain SwiftUI’s software architecture together with its core components, including the observation framework, bindings, the view protocol, and the render tree. In this talk, I will focus on the underlying concepts and not on a particular implementation.
Licensed to the public under https://creativecommons.org/licenses/by/3.0/de