Author: user user

Background view modifier does not create a new instance of its view when the parent view reloads

Problem In SwiftUI, I use a ForEach that loads a few that uses the background view modifier. When the ForEach loop reloads because the model changes, then the view gets updated. But the instance that is created in the background view modifier is reused. Why? Details Given the following view struct PathView: some View { […]