UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Plus button becomes unresponsive once the second view is dismissed.

Forums > 100 Days of SwiftUI

@Bnerd  

I am following along Paul's projects and I have noticed that whenever I use .sheet to view a second view and dismiss it using

@Environment(\.dismiss) var dismiss

and

dismiss()

the parent view toolbaritem + I am using becomes unresponsive.. I found work around on internet but it seems that it is a bug that it is still not addressed.. Did you encounter it? If yes how did you solve it?

P.S. as a solution I have added the following to my ContentView

@Environment(\.dismiss) private var dismiss

and

.id(UUID())

after my sheet. As you can see in the clip : https://imgur.com/a/mG58sa6 although it works, there is one sec lag..or something..

1      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.