DEV Community

Anuja Piayadigama
Anuja Piayadigama

Posted on

How to pass data from a parent model class to a subview in SwiftUI

I am having my main view in ContentView class and I do the network call in ContentViewModel class and update a class call User with the response.

My ContentView has several subviews such as HeaderView. When I update the User class properties from the API response, I want to update…

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay