I wanted to know when a text is wrapped by the frame of the text view is there any delimiter with which we can identify whether the text is wrapped or not.
For insta
Swift extension:
Using @himanshu padia answer
//MARK: - UITextView
extension UITextView{
func numberOfLines() -> Int{
if let fontUnwrapped = self.font{
return Int(self.contentSize.height / fontUnwrapped.lineHeight)
}
return 0
}
}
Usage : yourTextView.numberOfLines()
be aware that if for some reason the font of the text view is nil, the return will be zero.