<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if" -->

---
title: SwiftUI data dependencies and their effect on view updates
description: A detailed comparison of how different SwiftUI data dependency mechanisms—plain stored properties, reference types, closures, @State/@Binding,...
canonical: https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: SwiftUI data dependencies and their effect on view updates | daily.dev
og:description: A detailed comparison of how different SwiftUI data dependency mechanisms—plain stored properties, reference types, closures, @State/@Binding,...
og:url: https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if
og:image: https://api.daily.dev/og/posts/2kP42I6iF.png
og:image:alt: SwiftUI data dependencies and their effect on view updates
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SwiftUI data dependencies and their effect on view updates

**[Nil Coalescing](https://daily.dev/sources/nilcoalescing)** · 15 min read · 1 upvotes · 0 comments

## Summary

A detailed comparison of how different SwiftUI data dependency mechanisms—plain stored properties, reference types, closures, @State/@Binding, @Environment/@FocusedValue, @Observable models, and ObservableObject property wrappers—affect when a view's body is reevaluated. Explains that stored value-type inputs are always compared regardless of usage, reference types only change identity on replacement, state/bindings become dependencies only after first read, environment/focused values behave like stored inputs, @Observable tracks per-property access dynamically, and ObservableObject triggers on any published property change regardless of usage. Recommends preferring @Observable over ObservableObject for more precise update tracking, and includes promotional links to the author's SwiftUI books at the end.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nilcoalescing.com/blog/SwiftUIDataDependenciesAndTheirEffectOnViewUpdates>

## Questions this post answers

### Why does my SwiftUI view's body run again even though it doesn't use the property that changed?

Plain stored properties remain part of a view's input value whether or not body reads them, so SwiftUI compares them on every parent update and reevaluates the view if any stored value differs, even an unused one. The fix is to remove inputs the view no longer needs from its initializer.

_Developers debugging unnecessary SwiftUI re-renders can find deeper breakdowns like this through daily.dev._

### Does mutating a property on a class instance passed into a SwiftUI view trigger a body update?

No, mutating a property on an existing plain reference type instance does not change the reference itself, so SwiftUI still sees the same instance and does not reevaluate the view's body. Only replacing the instance with a new one causes a body reevaluation, which is why plain classes need an observation mechanism like @Observable to reflect in-place changes.

_Teams choosing between plain classes and @Observable models for SwiftUI state can weigh this trade-off via daily.dev._

### What's the difference between @Observable and ObservableObject in how they trigger SwiftUI view updates?

@Observable tracks dependencies at the individual property level, recalculating them on every body evaluation, so a view only reevaluates when a property it actually reads changes. ObservableObject, used with @StateObject, @ObservedObject, or @EnvironmentObject, subscribes to a single object-wide objectWillChange notification, so any @Published property change reevaluates the view regardless of which properties its body reads.

_Developers migrating SwiftUI models from ObservableObject to Observable can check the update behavior differences on daily.dev._

## Similar posts on daily.dev

- [Who Told The View To Update?](https://daily.dev/posts/who-told-the-view-to-update--xvxtydysb) · Medium · 0 upvotes · 0 comments
- [@StateObject vs. @ObservedObject: The differences explained](https://daily.dev/posts/stateobject-vs-observedobject-the-differences-explained-m59jsolm0) · SwiftLee · 0 upvotes · 0 comments

---

Tags: [#ios](https://daily.dev/tags/ios), [#swift](https://daily.dev/tags/swift), [#swiftui](https://daily.dev/tags/swiftui)

[View this post on daily.dev](https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"SwiftUI data dependencies and their effect on view updates","url":"https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if"},"datePublished":"2026-08-30T09:25:51.472Z","dateModified":"2026-09-14T07:32:53.421Z","description":"A detailed comparison of how different SwiftUI data dependency mechanisms—plain stored properties, reference types, closures, @State/@Binding,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f66e84612d9d4e7228ef36ce983de554?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f66e84612d9d4e7228ef36ce983de554?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Nil Coalescing","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Nil Coalescing","logo":"https://media.daily.dev/image/upload/s--rcEu6sag--/f_auto,q_auto/v1785654899/logos/nilcoalescing?_a=BAMAMicg0","url":"https://daily.dev/sources/nilcoalescing"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,swiftui","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nil Coalescing","item":"https://daily.dev/sources/nilcoalescing"},{"@type":"ListItem","position":3,"name":"SwiftUI data dependencies and their effect on view updates"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/swiftui-data-dependencies-and-their-effect-on-view-updates-2kp42i6if#faq","mainEntity":[{"@type":"Question","name":"Why does my SwiftUI view's body run again even though it doesn't use the property that changed?","acceptedAnswer":{"@type":"Answer","text":"Plain stored properties remain part of a view's input value whether or not body reads them, so SwiftUI compares them on every parent update and reevaluates the view if any stored value differs, even an unused one. The fix is to remove inputs the view no longer needs from its initializer. Developers debugging unnecessary SwiftUI re-renders can find deeper breakdowns like this through daily.dev."}},{"@type":"Question","name":"Does mutating a property on a class instance passed into a SwiftUI view trigger a body update?","acceptedAnswer":{"@type":"Answer","text":"No, mutating a property on an existing plain reference type instance does not change the reference itself, so SwiftUI still sees the same instance and does not reevaluate the view's body. Only replacing the instance with a new one causes a body reevaluation, which is why plain classes need an observation mechanism like @Observable to reflect in-place changes. Teams choosing between plain classes and @Observable models for SwiftUI state can weigh this trade-off via daily.dev."}},{"@type":"Question","name":"What's the difference between @Observable and ObservableObject in how they trigger SwiftUI view updates?","acceptedAnswer":{"@type":"Answer","text":"@Observable tracks dependencies at the individual property level, recalculating them on every body evaluation, so a view only reevaluates when a property it actually reads changes. ObservableObject, used with @StateObject, @ObservedObject, or @EnvironmentObject, subscribes to a single object-wide objectWillChange notification, so any @Published property change reevaluates the view regardless of which properties its body reads. Developers migrating SwiftUI models from ObservableObject to Observable can check the update behavior differences on daily.dev."}}]}
```

