Skip to content

Conversation

@stephencelis
Copy link
Member

We have an explicit initializer for this conversion, but it's not super discoverable and it's generalized to all optionals. We can make a shorthand for Void payloads, which simplifies presentation:

-.sheet(isPresented: Binding($destination.sheet)) {
+.sheet(isPresented: $destination.sheet) {
   // ...
 }

Other changes:

  • SwiftUI.Binding<Bool>(Binding<Optional>)'s implementation strayed slightly from UIKit's UIBinding implementation, where issues were not reported. This is fixed.

  • Added missing documentation.

We have an explicit initializer for this conversion, but it's not super
discoverable and it's generalized to all optionals. We can make a
shorthand for `Void` payloads, which simplifies presentation:

```diff
-.sheet(isPresented: Binding($destination.sheet)) {
+.sheet(isPresented: $destination.sheet) {
   // ...
 }
```

Other changes:

- `SwiftUI.Binding<Bool>(Binding<Optional>)`'s implementation strayed
  slightly from UIKit's `UIBinding` implementation, where issues were
  not reported. This is fixed.

- Added missing documentation.
@mbrandonw mbrandonw merged commit 116496f into main Feb 20, 2025
3 of 8 checks passed
@mbrandonw mbrandonw deleted the binding-updates branch February 20, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants