/calayer-cgcolor-for-ib-swift

Use UIColor in interface builder for CALayer properties

Primary LanguageSwiftThe UnlicenseUnlicense

CALayer extension for using UIColor with CALayer

A simple extension for CALayer (in Swift) which allows you to set UIColor against the shadowColor and borderColor properties so they can be set within Interface Builder:

calayer-cgcolor-for-ib-swift example

calayer-cgcolor-for-ib-swift example result

Example Usage

Simply set the property layer.IBShadowColor or layer.IBBorderColor as a UIColor in Interface Builder and at runtime the appropriate CGColor will be used.