Christian Selig on Nostr: SwiftUI question of the week: if I want to use a Circle sometimes and a Rectangle in ...
SwiftUI question of the week: if I want to use a Circle sometimes and a Rectangle in other cases, and apply a stroke to either, how do I encompass that generic Shape so the compiler is happy? The following spits out errors about needing generic constraints.
Published at
2023-08-21 14:37:43Event JSON
{
"id": "09a7d7abc379a7a8c4c9c642b6f164aec200893c6e5b9f0e524ffb6165aac4bd",
"pubkey": "de6adda4d139627ce8f9cf05ef27c7cd1de9895363e5f303667f761bec318716",
"created_at": 1692628663,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/christianselig/statuses/110928112058743437",
"activitypub"
]
],
"content": "SwiftUI question of the week: if I want to use a Circle sometimes and a Rectangle in other cases, and apply a stroke to either, how do I encompass that generic Shape so the compiler is happy? The following spits out errors about needing generic constraints.\n\nhttps://files.mastodon.social/media_attachments/files/110/928/111/790/803/377/original/86c399ceaee43c2a.png",
"sig": "4b9fd928041cd56e1ee611ae7a3bfc90e713e9797f0a288664e048e931402b178f9f209ced115e65e5184a5cbc52606878347c0ebb774348606473d8c2af3692"
}