Christian Selig on Nostr: Silly SwiftUI @Observable question: how do I bind to an unwrapped optional? Say I ...
Published at
2024-03-28 14:55:52Event JSON
{
"id": "20d9850e7c7c27ff9595f97ae9e08e8c02c4b3a546fd889f5a023329b66fba84",
"pubkey": "de6adda4d139627ce8f9cf05ef27c7cd1de9895363e5f303667f761bec318716",
"created_at": 1711637752,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/christianselig/statuses/112173891776076938",
"activitypub"
]
],
"content": "Silly SwiftUI @Observable question: how do I bind to an unwrapped optional? Say I want to show a View when an optional is non-nil, and then bind to a variable it contains? Or is this not possible? I've tried sprinkling @Bindable 🤔\n\nCode: https://gist.github.com/christianselig/4b835f6544ffe1c5c104ade74da8459e\n\nhttps://files.mastodon.social/media_attachments/files/112/173/891/498/315/763/original/d79ebdb8685900f1.jpeg",
"sig": "588f9a48e67a7120aa9a995b9d2cdbe60c11cceddc7aa00a0f157865b57242b683161607a8318ec821da4fb5077e802f5e0f09f234334eeb2c820d7b439a31a9"
}