@objc fileprivate func updateFrames() {
guard inView != nil else { return }
y = 0
offsetY = 0
var textSize: CGSize = .zero
if let attrText = messageText.attributedText {
let size = CGSize(width: textWidth , height: 999)
let framesetter = CTFramesetterCreateWithAttributedString(attrText)
textSize = CTFramesetterSuggestFrameSizeWithConstraints(framesetter, CFRange(), nil, size, nil)
}
if textNumberOfLines == 0 {
height = max(ceil(textSize.height / 2) + padding.vertical, height)
}
calculatePosition()
updateMessageFrame()
updateCornerRadius()
updateMessageTextSize(textSize: textSize)
}
if textNumberOfLines == 0 {
height = max(ceil(textSize.height / 2) + padding.vertical, height)
}
if textNumberOfLines == 0 {
height = max(ceil(textSize.height ) + padding.vertical, height)
}