Created
May 18, 2017 06:29
-
-
Save anonymous/dda0e4938969437440dd0919a4e1c92b to your computer and use it in GitHub Desktop.
the description for this gist
This file contains 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 | |
@IBDesignable | |
class ActionButton: UIButton { | |
@IBInspectable var cornerRadius: CGFloat = 0 { | |
didSet { | |
layer.cornerRadius = cornerRadius | |
layer.masksToBounds = cornerRadius > 0 | |
} | |
} | |
@IBInspectable var borderWidth: CGFloat = 0 { | |
didSet { | |
layer.borderWidth = borderWidth | |
} | |
} | |
@IBInspectable var borderColor: UIColor? { | |
didSet { | |
layer.borderColor = borderColor?.cgColor | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment