Custom Buttons
Create a swift file for custom button
Create a custom button class
class CustomButton: UIButton {
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.layer.borderColor = UIColor.yellowColor().CGColor
self.layer.borderWidth = 5
self.backgroundColor = UIColor.redColor()
}
}
Define custom button class in Storyboard
For custom button with imageview and label
Create view and add imageview and label in view
Add button on image view and label
Define constraints
Result
You can download from https://github.com/ozlemakalin/custombuttonswift
Hiç yorum yok:
Yorum Gönder