Post

Replies

Boosts

Views

Activity

Reply to Search in a bottom toolbar
I also had a hard time figuring this out, but finally found it. In addition to having the .searchhable view modifier, you also need to put a search toolbar item in your toolbar, like this: DefaultToolbarItem(kind: .search, placement: .bottomBar)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to SwiftUI NavigationLink freezing when tapped
I found this post by a SwiftUI engineer describing the issue, what's causing it and how to fix it. https://hachyderm.io/@teissler/112533860374716961 Basically, if the view in the navigationDestination references any property in the presenting view, it will capture self and all its properties. This is a problem if you have environment values that are not Equatable (like \.dismiss) and will cause a SwiftUI cycle that freezes the app. The solution is to use a capture list in the navigationDestination closure to only capture the properties that are needed to construct the presented view. Also, if you have custom environment values, make them Equatable whenever possible to avoid this issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24