Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. let label = UILabel()
  2. let button = UIButton()
  3. let input1 = UITextField()
  4.  
  5.  
  6. override func viewDidLoad() {
  7. super.viewDidLoad()
  8.  
  9. label.frame = CGRect(x: 24, y: self.view.frame.height - 60, width: self.view.frame.width - 48, height: 60)
  10. label.text = "Coucou"
  11.  
  12.  
  13. button.frame = CGRect(x: 24, y: label.frame.origin.y - (60), width: self.view.frame.width - 48, height: 60)
  14. button.setTitle("Button Title", for: .normal)
  15. button.backgroundColor = UIColor.green
  16.  
  17. input1.frame = CGRect(x: 24, y: button.frame.origin.y - (60), width: self.view.frame.width - 48, height: 60)
  18. input1.backgroundColor = UIColor.green
  19.  
  20. self.view.addSubview(label)
  21. self.view.addSubview(button)
  22. self.view.addSubview(input1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement