Skip to content

Instantly share code, notes, and snippets.

@Pasanpr
Created January 22, 2018 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pasanpr/ddfb669140a5c34b4ec98252ae006f84 to your computer and use it in GitHub Desktop.
Save Pasanpr/ddfb669140a5c34b4ec98252ae006f84 to your computer and use it in GitHub Desktop.
import UIKit
class SimpleStackViewController: UIViewController {
lazy var imageView: UIImageView = {
let imageView = UIImageView(image: #imageLiteral(resourceName: "mountains"))
imageView.contentMode = .scaleAspectFit
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
lazy var label: UILabel = {
let label = UILabel()
label.text = "Mountains"
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
lazy var button: UIButton = {
let button = UIButton(type: .system)
button.setTitle("Like", for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment