Being a Swift fanboy, I have already downloaded Xcode 9 Beta and started delving into some of the cool features, CoreML and ARKit. However I find myself amazed at the little things, and I thought I would share one with you.
I like building views programmatically, and I won’t get into why or which is better storyboards vs. programmatic layouts, they both have their place. Normaly I create RGB values and store them in a struct to use all over my project, this way I can update them once and my whole project will update.
The only problem with this was when I needed to use storyboards I had to repeat my value again in the Attributes Inspector and being a programmer I hate repeating myself, but with Xcode 9 this is now a thing of the past. You can now create a colour set in the assets folder, and it can then be used in storyboards and code, see below for examples. So now my designer or I can update colours in one place, and it updates the entire app. Now, this feature is slightly buggy in the Xcode 9 Beta sometimes when selecting the colour in Storyboards you just get black, but Apple will have this fixed for the official release.
First, we create the colour set.
Then we can use it in code.
And in storyboards.