Last active
November 26, 2017 09:41
-
-
Save Deub27/84e486f9c64eeac87c37ee6a0ab1a810 to your computer and use it in GitHub Desktop.
Use IB to setup border and shadow layer color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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