Advertisement
Guest User

-

a guest
Apr 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.36 KB | None | 0 0
  1. extension UIButton {
  2.     func setStyle(backgroundColor: UIColor, titleColor: UIColor, isBordered: Bool) {
  3.         layer.cornerRadius = 5
  4.         self.backgroundColor = backgroundColor
  5.         self.setTitleColor(titleColor, for: .normal)
  6.         if isBordered {
  7.             layer.borderWidth = 1
  8.             layer.borderColor = titleColor.cgColor
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement