NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

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?


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.


Hacking with Swift is sponsored by Fernando Olivares

SPONSORED Ever ask for help and your reviewer immediately notices issues you missed? Fernando Olivares is a 10-year veteran from Big Nerd Ranch and Lambda School who can help hone your app building skills, and he's just launched a new book that does just that – use the code "hacking" to save $5!

Buy the book

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

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

Not logged in

Log in

Link copied to your pasteboard.