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
Share
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…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture