SwiftUI is a complex beast. Going through the codebase as well as other articles by people who've tried to understand how it concretely works, I recognize the following distinct graphs and hierarchies conceptually:
- The attribute graph (
OGGraph and OGSubgraph, subgraphs can own subgraphs and attributes)
ViewGraph
Some questions that I don't have a good answer to despite going over the codebase a dozen times:
- How do
ViewInputs and ViewOutputs relate to AttributeGraph? I see sifting through a lot of indirection that they're creating Attributes in many places, I'm assuming the initialization/mutation of these attributes are tracked by some AttributeGraph-owned closure that they are being executed within.
- What is the lifecycle of a
ViewGraph?
- Does
ViewGraph maintain its hierarchy solely through PreferenceBridge?
DisplayList?
- What other hierarchies are known to you?