Created
April 24, 2019 13:20
-
-
Save onmyway133/49474a384f3560b00c4be768a584222a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
let box = UIView() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
box.backgroundColor = UIColor.red | |
view.addSubview(box) | |
} | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
box.frame = CGRect(x: 20, y: 50, width: view.frame.size.width - 40, height: 100) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment