Type Safely

Type Safely

Use Custom Colours From Assets Without Relying On Strings

Daily Coding Tip 293

Type Safely's avatar
Type Safely
Jul 06, 2022
∙ Paid
man wearing black jacket
Photo by Mario Gogh on Unsplash

Before Xcode 15 you could create a Color Set in your Assets catalog, but you could only use it like this:

.foregroundColor(Color("exampleColour"))

Now it’s possible to do something that doesn’t involve raw strings, and therefore isn’t in danger of becoming an invalid colour due a typo.

The first thing I need to do is create a…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture