Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.96 KB | None | 0 0
  1.     func setButtonUI (containerView: UIStackView) {
  2.         for view in containerView.subviews {
  3.             if let btn = view as? UIButton {
  4.                 btn.layer.cornerRadius = 10
  5.                 btn.setTitleColor(UIColor(red: 0.0/255.0, green: 51.0/255.0, blue: 102.0/255.0, alpha: 1.0), for: .normal)
  6.    
  7.                 btn.layer.shadowRadius = 0.5
  8.                 btn.layer.shadowOpacity = 0.5
  9.                 btn.layer.shadowOffset = CGSize(width: 0.5, height: 0.5)
  10.                
  11.  
  12.                 btn.layer.backgroundColor = UIColor.white.cgColor
  13.                
  14.                 //here is where im testing the Q key, where
  15.                 //where title and bg is changing, but the radius, opacity and offset isnt :(
  16.                 if btn.currentTitle == "Q" {
  17.                     btn.setTitle("F", for: .normal)
  18.                     btn.layer.backgroundColor = UIColor.black.cgColor
  19.                 }
  20.                
  21.             }
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement