Advertisement
Guest User

Untitled

a guest
May 20th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. //
  2. // MyButton.swift
  3. // foodle
  4. //
  5. // Created by Maxim Kuba on 5/20/18.
  6. // Copyright © 2018 Maxim Kuba. All rights reserved.
  7. //
  8.  
  9. import Foundation
  10. import UIKit
  11.  
  12.  
  13.  
  14. class MyButton: UIButton {
  15.  
  16. required init?(coder aDecoder: NSCoder) {
  17. super.init(coder: aDecoder)
  18.  
  19. var test = false
  20.  
  21. func changeView(check: Bool)
  22. {
  23. if (test == true)
  24. {
  25. backgroundColor = UIColor.white
  26. setTitleColor(UIColor.black, for: [])
  27. }
  28.  
  29. }
  30.  
  31.  
  32.  
  33.  
  34. layer.borderWidth = 1.0
  35.  
  36. let myColor = UIColor.clear
  37. layer.borderColor = myColor.cgColor
  38.  
  39.  
  40. layer.cornerRadius = 15.0
  41. clipsToBounds = true
  42.  
  43.  
  44.  
  45.  
  46. }
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement