Post

Replies

Boosts

Views

Activity

Reply to Update a view from a button in another view.
I tried to create an app with full SwiftUI to see how it works and experiment a bit with it, but as you note, I also found out that it's inflexible, a bit limited and kind of immature at the moment. With UIKit you could do almost whatever you wanted, but my main issue, was with positioning the elements on the screen with constrains. I guess next time I'll merge UIKit with a few SwiftUI components to get the best of both. Anyway, thanks for the answers.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Update a view from a button in another view.
Hello Claude31, I tried to make it work, but it didn't, so I added a workaround (which I don't really like, to be honest) which repeats some parts of the code two times based on the toggle of a Bool variable. Here is the repository for the project: GitHub Link - https://github.com/Chpetrou/StampJourney. If you know some other way to properly implement this, please inform me.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Update a view from a button in another view.
Thanks for the answer! I tried to apply this to my code, but i couldn't make it work. The problem is, I use SwiftUI and it's a SwiftUI app, so it does not have a viewDidLoad and it's also not a class but a struct, so i couldn't use the addObserver function. Also, I still haven't understood how am I going to refresh my view, as it's a navigation link that points to another view that has a viewBuilder struct with a list that returns the data in a closure variable. That view is like: Swift struct GroupListView: View {         var body: some View {                 VStack {                         /* Custom viewBuilder struct */                 FilteredList(parameters: viewModel.filterParameters) { (item: EntityItem) in                                 /* View for nicely displaying the rows */                                 /* (This view is the first one in my question description which has one of the buttons) */                         ListRow(rowValue: item)                 }                 }         } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Update a view from a button in another view.
Hello Claude31, Thanks for the answer! I searched for how I could use notifications to refresh my view, but all I found was about push and local notifications, shown in the notification center as a feedback to the user. I couldn't find something that would send an "internal" notification to the other view. Do you have a sample or a website, that explains how I could implement this, and also when the view receives the notification, how would it refresh?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21