Skip to content

Instantly share code, notes, and snippets.

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 pcperini/bb178ff2304702a83036 to your computer and use it in GitHub Desktop.
Save pcperini/bb178ff2304702a83036 to your computer and use it in GitHub Desktop.
public extension ConstraintStateMachineType where Self: UIViewController {
// MARK: Properties
var allConstraints: [NSLayoutConstraint] {
return self.view.flatConstraints // helper function, recursively collects constraints
// https://gist.github.com/pcperini/5a8ea37e8cbbe904a031
}
// MARK: Mutators
func setNeedsUpdateConstraints() {
self.view.setNeedsUpdateConstraints()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment