This package is used to programmatically add constraints. It works great with stack views.
Important:
// - Stack Views -
buttonsHorizontalStackView = UIStackView(arrangedSubviews: [saveContainerView, infoContainerView, adminContainerView, UIView()])
buttonsHorizontalStackView.axis = .horizontal
stackView = UIStackView(arrangedSubviews: [
givenNameContainerView,
familyNameContainerView,
plateNumberContainerView,
submitContainerView,
buttonsHorizontalStackView])
stackView.axis = .vertical
view.addSubview(stackView)
// - Constraints -
stackView.constrainTo(view.safeAreaLayoutGuide, .allBorders)
buttonsHorizontalStackView.constrainHeightTo(72)
saveBackgroundView.constrainTo(saveContainerView, [.top(16), .bottom(-16), .leading(16), .trailing])
infoBackgroundView.constrainTo(infoContainerView, [.top(16), .bottom(-16), .leading(8), .trailing])
adminBackgroundView.constrainTo(adminContainerView, [.top(16), .bottom(-16), .leading(8), .trailing])
submitContainerView.constrainHeightTo(72)
submitBackgroundView.constrainTo(submitContainerView, .allBorders(16))
The contents of this repository is licensed under the Apache License, version 2.0.
link |
Stars: 0 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics