Skip to content

Instantly share code, notes, and snippets.

@Anatoli-Petrosyants
Created April 29, 2018 20:11
Show Gist options
  • Select an option

  • Save Anatoli-Petrosyants/19e4b663ee71f7cabd16639e1408ed4a to your computer and use it in GitHub Desktop.

Select an option

Save Anatoli-Petrosyants/19e4b663ee71f7cabd16639e1408ed4a to your computer and use it in GitHub Desktop.
lazy var v1:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v
}()
lazy var v2:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v
}()
lazy var stack:UIStackView = {
let s = UIStackView(frame: self.view.bounds)
s.axis = .Vertical
s.distribution = .FillEqually
s.alignment = .Fill
s.spacing = 5
s.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
s.addArrangedSubview(self.v1)
s.addArrangedSubview(self.v2)
return s
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment