onDisappear() and onAppear()

Hi, In my SwiftUI app, I have a settings and a content view. I use UserDefaults to save the settings and I user onDisappear() to save it in the UserDefaults. In the content View, I use onAppear() to look for the settings, and if I print both out, the onAppear() function get called in front of the onDisappear() function. Why? Can you help me?
Can you show us enough code to reproduce the issue?
onDisappear() and onAppear()
 
 
Q