Created
January 6, 2019 20:10
-
-
Save pedrommcarrasco/11ad48d9a90e66d5586c01b43b14f261 to your computer and use it in GitHub Desktop.
Guide Your Layout - Constraints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSLayoutConstraint.activate( | |
[ | |
layoutGuide.centerYAnchor.constraint(equalTo: view.centerYAnchor), | |
layoutGuide.leadingAnchor.constraint(equalTo: view.leadingAnchor), | |
layoutGuide.trailingAnchor.constraint(equalTo: view.trailingAnchor), | |
photoImageView.topAnchor.constraint(equalTo: layoutGuide.topAnchor), | |
photoImageView.centerXAnchor.constraint(equalTo: layoutGuide.centerXAnchor), | |
photoImageView.widthAnchor.constraint(equalTo: photoImageView.heightAnchor), | |
photoImageView.heightAnchor.constraint(equalToConstant: 250), | |
introLabel.topAnchor.constraint(equalTo: photoImageView.bottomAnchor, constant: 16), | |
introLabel.bottomAnchor.constraint(equalTo: layoutGuide.bottomAnchor), | |
introLabel.leadingAnchor.constraint(equalTo: photoImageView.leadingAnchor), | |
introLabel.trailingAnchor.constraint(equalTo: photoImageView.trailingAnchor) | |
] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment