Add spacerWidth

pull/2/head
Michael Scoff 7 years ago
parent a42ece16fa
commit c6df28df6e
  1. 11
      Trust/Extensions/UIView.swift

@ -32,10 +32,19 @@ extension UIView {
static func spacer(height: CGFloat = 1) -> UIView {
let view = UIView(frame: .zero)
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
view.heightAnchor.constraint(equalToConstant: height),
])
return view
}
static func spacerWidth(_ width: CGFloat = 1) -> UIView {
let view = UIView(frame: .zero)
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
view.widthAnchor.constraint(equalToConstant: width),
])
return view
}

Loading…
Cancel
Save