For what one non-SwiftUI engineer's opinion is worth, I think the two closure arguments are in the wrong order for Swift 5.3 anyway—that is, the current design makes you write this:
sheet(isPresented: $isPresented) {
doThing()
} content: {
Text("Hello")
}
But it would be more natural to write this:
sheet(isPresented: $isPresented) {
Text("Hello")
} onDismiss: {
doThing()
}
And, if the API was redesigned to do so, then omitting the onDismiss:
closure would also get the behavior you want.
I suspect that the current API was designed specifically for the limitations of Swift 5.1's trailing closure support; with multiple trailing closures and this proposed change, the rules are now different, and the SwiftUI folks might want to reconsider the parameter order in that light. (If they leave the old methods but remove the default value for onDismiss
, this won't cause a source or ABI break, and it could probably be backwards-deployed.) But an Evolution proposal can't change SwiftUI, so this is drifting off-topic.