# AttributeGraph and SwiftUI's Dependency Tracking

DevFeed: [AttributeGraph and SwiftUI's Dependency Tracking](<https://devfeed.tech/articles/making-friends-with-attributegraph-27361.md>)

Original publisher: [Read original article](<https://saagarjha.com/blog/2024/02/27/making-friends-with-attributegraph/>)

Published: 2024-02-27T00:00:00Z

Content type: article

Language: en

Sources: [Saagar Jha](<https://devfeed.tech/sources/saagar-jha.md>)

Topics: [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [ui](<https://devfeed.tech/topics/ui.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [graph](<https://devfeed.tech/tags/graph.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

The article examines AttributeGraph, a private C++ framework underlying SwiftUI, and explains how its attribute graph tracks data dependencies and helps determine when app updates are needed. It focuses on understanding SwiftUI's behavior through testable implementation hypotheses rather than using private APIs directly.

## Source excerpt

If you've used SwiftUI for long enough, you've probably noticed that the public Swift APIs it provides are really only half the story. Normally inconspicuous unless something goes exceedingly wrong, the private framework called AttributeGraph tracks almost every single aspect of your app from behind the scenes to make decisions on when things need to be updated. It would not be much of an exaggeration to suggest that this C++ library is actually what runs the show, with SwiftUI just being a thin veneer on top to draw some platform-appropriate controls and provide a stable interface to program against. True to its name, AttributeGraph provides the foundation of what a declarative UI framework needs: a graph of attributes that tracks data dependencies.