|
This code immediately below kinda half works, but not totally. I'm only trying to pass a boolean in one direction.
The code below achieves the desired result because it's using a class which both views can access, but I'm confused why the ContentView can't pass the value to the AddView using the code above.
Could someone please help me? |
|
I think it's just SwiftUI getting a bit confused. If you change your code to this, it works:
In this code, you are changing the state of |
|
***Yep. That works great. Much cleaner than my fix. Thanks. Ok, so that doesn't quite work, or it doesn't achieve what I was hoping. Initially, it does but if you press the button for true, dismiss the sheet and press the button for true it doesn't launch AddView the 2nd or 3rd or nth time. It only launches when you switch back and forth between true and false.
|
|
Ok, so using a small modification to your suggestion, this works:
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.
Link copied to your pasteboard.