Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view, typically from a nib.
- let button = UIButton(type: .system)
- button.setTitle("ahoj", for: .normal)
- view.addSubview(button)
- button.translatesAutoresizingMaskIntoConstraints = false
- button.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
- button.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
- button.addAction(for: .touchUpInside) {
- print("ahoj")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement