Easy ways to use Color Swatches in SwiftUI
Using Format’s Show Colors to choose Colors for the Views in SwiftUI
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
Edit → Format → Show 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.