I started adding the landscape mode to the StoreSearch app and came across something very peculiar. After adding the transitions and animations (before adding the scroll view) the DetailViewController
suddenly didn’t show the correct data of the selected item anymore.
During debugging I learned, that the DetailViewController
did not receive the searchResult
despite the prepareForSegue
function trying to update the searchResult
variable in DetailViewController
.
After some more debugging I noticed that the prepareForSegue
function somehow did not try to update the searchResult
variable, but the dismissAnimationStyle
variable that I had put above the searchResult
variable.
So when I moved the AnimationStyle
enum as well as the dismissAnimationStyle
variable below the searchResult
variable, everything worked fine again. Rebooting the simulator and restarting Xcode hadn’t helped.
Does anyone have an idea why the order of the variables has an influence on the functionality in this case or in general? Any ideas or explanations are appreciated!