Landmarks Tutorial Favorites Bounce Back Follow-up

Viewed 72

A few months ago a question was asked about weird bounce-back behavior in the Landmarks Tutorial when you a unfavorite an item.

SwiftUI Landmarks App Tutorial Screen Navigates Back When Toggle Favorite

That behavior no longer happens at that "Handling User Input" step of the tutorial that the question referred to when using the most recent files and the most recent Xcode... but it reappears later in the "Composing Complex Interfaces" step when the root of the NavigationView moves from LandmarkList.swift to Home.swift

I understand about using @State/.onAppear/.onDisappear as a handling layer as a solution in ones own code, but I'm curious about why the patch only worked partially? So they fixed it, but then the fix failed when the @EnvironmentObject NavigationView is now another level away?

I'm sorry I don't know how to find the "feedback" conversations to see if this is being discussed there.

UPDATE I: Aha! It does NOT exhibit the bounce back behavior when you

  1. favorite a new item
  2. return to the list view
  3. switch list to favorites only
  4. return to the detail view of the newly favortied item
  5. unfavorite it

It DOES exhibit the behavior if you

  1. unfavorite one of the original favorites (Say, Turtle Rock)
  2. return to the list view,
  3. mess around with a different landmark (see the first set of steps)
  4. go back in and refavorite it
  5. return to list view and switch it to favorites only
  6. Navigate back to detail view and unfavorite it

Movie: https://imgur.com/a/ctrghG1

UPDATE II: Apparently it isn’t the difference between the initial favorites and everyone else… it’s only the LAST item in the favorites list that gets exempted from the bounce back behavior.

0 Answers
Related