Skip to content

Instantly share code, notes, and snippets.

@ksmandersen
Last active January 18, 2016 17:17
Show Gist options
  • Save ksmandersen/4fc0f85a9a82e551cd17 to your computer and use it in GitHub Desktop.
Save ksmandersen/4fc0f85a9a82e551cd17 to your computer and use it in GitHub Desktop.
import UIKit
class GenericView: UIView {
let stackView = UIStackView()
init() {
super.init(frame: CGRectZero)
setup()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setup() {
addSubview(stackView)
stackView.setEdgesEqualToSuperview()
stackView.axis = .Horizontal
stackView.spacing = 0
translatesAutoresizingMaskIntoConstraints = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment