Easy ways to use Color Swatches in SwiftUI

Using Format’s Show Colors to choose Colors for the Views in SwiftUI

Nikhil Vinod
Jul 29, 2022

Drag and Drop

Click on Edit option in the Xcode top menu
Inside the Edit option you can find Format
Inside Format section select Show Colors

EditFormatShow Colors

Using Color Literals

We can simply use color literals to get the color swatch selection. For that we just have to type :

#colorLiteral()

As soon as we press the return button this will get a color swatch.

I hope you have understood how we can we easily get a color swatches picker for selecting color.
If you like this story, please share and follow my account for more stories like these. Do let me know if you have any queries or suggestions. Thanks for reading❤️

--

--