logoalt Hacker News

happytoexplaintoday at 1:46 AM1 replyview on HN

I have always treated state as the source of truth in UIKit. Every view gets an equatable state struct, and mutating it triggers an idempotent view update. Self-mutating views (e.g. inputs) back-propagate their state up the view hierarchy.

SwiftUI/React/etc don't introduce that pattern, they simply enforce it (and add efficiencies).

If a developer isn't familiar with the pattern, it's not because they are a UIKit dev, it's because they are inexperienced.


Replies

ajpaulsontoday at 4:41 AM

Any chance you have any links so I can read up on this approach?