Skip to content

Instantly share code, notes, and snippets.

@maxcampolo
Created January 19, 2016 22:35
Show Gist options
  • Save maxcampolo/7dea5bc28b2b9fb6febf to your computer and use it in GitHub Desktop.
Save maxcampolo/7dea5bc28b2b9fb6febf to your computer and use it in GitHub Desktop.
CALayer extension that adds borderUIColor as an attribute that can be set by key path in interface builder.
extension CALayer {
func borderUIColor() -> UIColor? {
return borderColor != nil ? UIColor(CGColor: borderColor!) : nil
}
func setBorderUIColor(color: UIColor) {
borderColor = color.CGColor
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment