Skip to content

Instantly share code, notes, and snippets.

@amlcurran
Created May 28, 2018 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amlcurran/b52f52c7d11678b1664fdfe6451e5c89 to your computer and use it in GitHub Desktop.
Save amlcurran/b52f52c7d11678b1664fdfe6451e5c89 to your computer and use it in GitHub Desktop.
func doStuff() {
keyInput.constrain(toSuperviewSafeArea: .top, .leading, insetBy: 16)
blurView.contentView.addSubview(valueInput)
valueInput.constrain(toSuperviewSafeArea: .trailing, .bottom, insetBy: 16)
verticalLayoutConstraint = keyInput.constrain(.bottom, to: valueInput, .top, withOffset: -8)
verticalLayoutConstraint.priority = .defaultHigh
verticalLayoutConstraint.isActive = false
sameWidthConstraint = keyInput.constrain(.width, to: valueInput, .width)
sameTopConstraint = keyInput.constrain(.top, to: valueInput, .top)
horizontalLayoutConstraint = keyInput.constrain(.trailing, to: valueInput, .leading, withOffset: -8)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment