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

How do I dismiss the SwiftUI ColorPicker?

Forums > SwiftUI

When using SwiftUI's ColorPicker, the picker modal appears, you select a color, and then nothing happens. How do I make the picker dismiss, and therefore make use of the selected color?

2      

on iOS touch the X (top right) or touch the top of the screen above the modal. The selected Color will be in your selection binding.

2      

im having an issue with the ColorPicker. After I pick the color and dismiss the picker, my parent view no longer has its EnvironmentObject and is crashing my app. This used to work but recently has started doing this. any help is appreciated.

2      

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.