Join Nostr
2025-05-12 17:53:42 UTC

John Siracusa on Nostr: It seems like the only practical way to make a View conform to Equatable is to do: ...

It seems like the only practical way to make a View conform to Equatable is to do:

`struct MyView : View, @preconcurrency Equatable { … }`

When I remove `@preconcurrency` I get the complaint that "Main actor-isolated operator function '==' cannot be used to satisfy nonisolated protocol requirement."

If I try `nonisolated static func == (…) { … }` instead, then I can't access the ``-isolated properties of MyView that I want to use in the `==` method body. What am I missing? #swiftui