Post

Replies

Boosts

Views

Activity

NavigationStack does not pop back if NavigationLink disappears
Imagine a SwiftUI View having an @ObservedObject var someObject that can update anytime in the background (for example via network connection) and showing a NavigationLink based on some condition of it: if someObject.someCondition { NavigationLink(destination: { DetailView() }, label: { ... }) } If you now tapped the NavigationLink, DetailView will be pushed on the current NavigationView. Now if afterwards someCondition would change to false, DetailView would be popped off again, since the Link to the View would not exist anymore: This was always the behaviour of NavigationViews with .navigationViewStyle(.stack) set since I use them. navigationViewStyle is deprecated now, but by using NavigationStack I don't get this behaviour anymore. The DetailView would stay on the Stack, even if the NavigationLink would not exist anymore at all. Is there a way to reproduce this "old behavior" again?
0
0
510
Apr ’23
Tip Event for high-occurrence Event
TipKit stores all Event donations including their Date locally. I am wondering if it's still good practise to have an Event for a action that happens a lot of times in my app (the main feature), since Power-Users could get over a million triggers of this event. This would result into millions of entries, but I only need a rule counting if the count is higher then 3. Would it be smarter to think of a different approach for this use-case to save storage (and maybe query speed), or is it still advised to use Events for something like this?
1
0
441
Mar ’24