You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Message cells using NSAttributedString constructed from Markdown String have height calculated wrong.
To Reproduce
Steps/code to reproduce the behavior in example app:
In SampleData.swift file, replace attributedString(with:) implementation with code below.
letmarkdownString="1. **Decide on the fasting method** (16/8, 5:2, etc.)\n2. *Consult with a healthcare provider* if you have health issues\n3. **Plan your meal times** to fit your schedule\n4. *Start with a shorter fasting period* and gradually increase\n5. **Drink plenty of water** to stay hydrated\n6. *Prepare healthy meals* for eating periods\n7. **Listen to your body** and adjust as needed\n8. *Avoid binge eating* after fasting periods\n9. **Stay consistent** with your fasting schedule\n10. *Track your progress* and make changes if necessary"
if #available(iOS 15,*){letmarkdownFormattingOptions=AttributedString.MarkdownParsingOptions(interpretedSyntax:.inlineOnlyPreservingWhitespace)varmutableAttributedString=(try?NSMutableAttributedString(markdown: markdownString, options: markdownFormattingOptions))??NSMutableAttributedString(string: markdownString)
mutableAttributedString.addAttributes([.font:UIFont.systemFont(ofSize:13)], range:.init(location:0, length: mutableAttributedString.string.count))return mutableAttributedString
}return NSAttributedString(string: markdownString)
In SampleData.swift file, replace randomMessage(allowedSenders:) implementation with code below.
Describe the bug
Message cells using
NSAttributedString
constructed from Markdown String have height calculated wrong.To Reproduce
Steps/code to reproduce the behavior in example app:
SampleData.swift
file, replaceattributedString(with:)
implementation with code below.SampleData.swift
file, replacerandomMessage(allowedSenders:)
implementation with code below.Expected behavior
Message cell should be sized correctly without cutting off text.
Screenshots
Text is cut off at the last line
Environment
MessageKit 4.2.0
iOS 17.2
Swift 5
iPhone 15 Pro (simulator)
Yes, see steps to reproduce.
The text was updated successfully, but these errors were encountered: