What is Nostr?
John Siracusa /
npub1lq7…hwvl
2025-01-16 16:59:00

John Siracusa on Nostr: Why can’t I find a simple way to do this? .textSelection(allowSelection ? .enabled ...

Why can’t I find a simple way to do this?

.textSelection(allowSelection ? .enabled : .disabled)

This code does not compile because the types don't match. Fine. But there should be a simple way to do this.

(This is why I never delete the dreaded .if(…) view modifier from my projects…)

#SwiftUWhy
Author Public Key
npub1lq7l458c6zqqgta485wgsw4eddwprfsmzaxu59ws2znyccdh9pas7vhwvl