Created
November 4, 2017 21:24
-
-
Save NickHung1982/f39b8110e78cc76de9a93d099c8a8dd9 to your computer and use it in GitHub Desktop.
update with use anchor
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
//setup centerY with cell | |
//let labelConstraintCenterY = NSLayoutConstraint(item: customLabel, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1, constant: 0) | |
//setup uilabel's height is equal 21 | |
//let labelConstraintHeight = NSLayoutConstraint(item: customLabel, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .height, multiplier: 1.0, constant: 21) | |
//self.addConstraints([labelConstraintCenterY]) | |
//Update use layout Anchor | |
customLabel.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true | |
customLabel.heightAnchor.constraint(equalToConstant: 21).isActive = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment