Hacker News new | ask | show | jobs
by lawgimenez 655 days ago
Also a current funny bug with SwiftUI, if you left out a “dot”, it will compile but crashes the app during runtime.

VStack { } navigationDestination(isPresented: $goToSettings) { }

There should be a dot before navigationDestination and this should not compile ever.

1 comments

That's not a bug. It's just calling `self.navigationDestination(isPresented:)`, which is a valid thing that exists. The same thing can happen anywhere that you're calling a method on an object which also exists on `self`.
It crashes the app on runtime.