22. November 2016

Using hex values with Ints

An Int can be initialized with a hexadecimal value, which is useful for storing color information.

static let White: Int = 0xFFFFFF
static let Black = 0x000000
static let fancyBlue = 0x00A4F8

This can be used with an extension on UIColor as described in Initialize UIColor with a hex value.