Add before .sheet modifier:
.onChange(of: assignment) { oldValue, newValue in
assignment = newValue
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: