Created
May 8, 2016 23:57
-
-
Save chelseatroy/04ca8edea77dfae547a1008f4fed51a2 to your computer and use it in GitHub Desktop.
Code-only UI Demonstration: ViewController
This file contains 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 MasterViewController: UIViewController { | |
var activityIndicatorView: UIActivityIndicatorView = UIActivityIndicatorView() | |
var baseView: UIView = UIView() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
baseView.frame = CGRect.zero; | |
baseView.translatesAutoresizingMaskIntoConstraints = false | |
let viewsDictionary = ["view": baseView] | |
view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat( | |
"H:|-0-[view]-0-|", options: [], metrics: nil, views: viewsDictionary)) | |
view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat( | |
"V:|-0-[view]-0-|", options: [], metrics: nil, views: viewsDictionary)) | |
self.view.addSubview(tableView) | |
... | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment