Something that tripped me up recently was not understanding how .onAppear { } behaves on iPad.
It gets called multiple times, even though the view is not visible.
Why? Logging reveals the size class is also changing, so presumably iOS is taking snapshots for the app switcher.
If like me you rely onAppear to denote a user has seen something (say, Mark as Read), you'll need to check the scenePhase first.
Here's a gist: https://gist.github.com/phillipcaudell/290eab2c42c4cc27cfdc0c595b40654d
@matt1corey the scenePhase reports .background, but yes! A little confusing at first, but I suppose it makes some sense.
@phill that’s a great catch!