Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func labelMaxHeight(_ label: UILabel) -> CGFloat {
- let maxFrameHeight: CGFloat = 80
- label.sizeToFit()
- let newFrameHeight = label.frame.size.height
- let safeNewHeight = min(newFrameHeight, maxFrameHeight)
- return safeNewHeight
- }
- Usage :
- addressHeight.constant = labelMaxHeight(addressValue)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement