Skip to content

Instantly share code, notes, and snippets.

@KanshuYokoo
Created March 13, 2019 17:55
Show Gist options
  • Save KanshuYokoo/7584b0e12913e8aec78ce6bedd968ef4 to your computer and use it in GitHub Desktop.
Save KanshuYokoo/7584b0e12913e8aec78ce6bedd968ef4 to your computer and use it in GitHub Desktop.
ios customise UIButton enable border radius
import UIKit
@IBDesignable class ButtonRadius: UIButton {
@IBInspectable var cornerRadius: CGFloat = 0.0 {
didSet{
self.layer.cornerRadius = cornerRadius
}
}
@IBInspectable var borderWidth: CGFloat = 0{
didSet{
self.layer.borderWidth = borderWidth
}
}
@IBInspectable var borderColor: UIColor = UIColor.clear{
didSet{
self.layer.borderColor = borderColor.cgColor
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment