Skip to content

Instantly share code, notes, and snippets.

@rlnucci
Last active May 28, 2020 21:36
Show Gist options
  • Select an option

  • Save rlnucci/eed2f7d18d389f887caa72e58019271f to your computer and use it in GitHub Desktop.

Select an option

Save rlnucci/eed2f7d18d389f887caa72e58019271f to your computer and use it in GitHub Desktop.
private func configureHorizontalStack() {
redView.addSubview(horizontalStack)
// Cartography method to declared constraints
let constraints = [
horizontalStack.leadingAnchor.constraint(equalTo: redView.leadingAnchor, constant: 30),
horizontalStack.trailingAnchor.constraint(equalTo: redView.trailingAnchor, constant: -30),
horizontalStack.topAnchor.constraint(equalTo: redView.topAnchor, constant: 25),
horizontalStack.bottomAnchor.constraint(equalTo: redView.bottomAnchor, constant: -25)
]
NSLayoutConstraint.activate(constraints)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment