Dynamically getting height of UILabel according to Text return different Value for iOS 7.0 and iOS 6.1
You have to dynamically set the frame, like below: Tested on iOS 6 to iOS 12.2 Swift: let constrainedSize = CGSize(width: self.titleLable.frame.size.width, height:9999) let attributesDictionary = [NSAttributedString.Key.font: UIFont.init(name: “HelveticaNeue”, size: 11.0)] let string = NSAttributedString.init(string: “textToShow”, attributes: attributesDictionary as [NSAttributedString.Key : Any]) var requiredHeight = string.boundingRect(with: constrainedSize, options: .usesLineFragmentOrigin, context: nil) if (requiredHeight.size.width > self.titleLable.frame.size.width) … Read more