Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Created May 8, 2016 23:57
Show Gist options
  • Save chelseatroy/04ca8edea77dfae547a1008f4fed51a2 to your computer and use it in GitHub Desktop.
Save chelseatroy/04ca8edea77dfae547a1008f4fed51a2 to your computer and use it in GitHub Desktop.
Code-only UI Demonstration: ViewController
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