Skip to content

Instantly share code, notes, and snippets.

@Deub27
Last active November 26, 2017 09:41
Show Gist options
  • Save Deub27/84e486f9c64eeac87c37ee6a0ab1a810 to your computer and use it in GitHub Desktop.
Save Deub27/84e486f9c64eeac87c37ee6a0ab1a810 to your computer and use it in GitHub Desktop.
Use IB to setup border and shadow layer color
import UIKit
import QuartzCore
extension CALayer {
@objc var borderUIColor: UIColor {
set {
self.borderColor = newValue.cgColor
}
get {
return UIColor(cgColor: self.borderColor!)
}
}
@objc var shadowUIColor: UIColor {
set {
self.shadowColor = newValue.cgColor
}
get {
return UIColor(cgColor: self.shadowColor!)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment