Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 16 lines truncated when text contains multiple paragraphs. #131

Open
tylerjames opened this issue Aug 8, 2022 · 3 comments
Open

iOS 16 lines truncated when text contains multiple paragraphs. #131

tylerjames opened this issue Aug 8, 2022 · 3 comments

Comments

@tylerjames
Copy link

tylerjames commented Aug 8, 2022

Everything works fine prior to the iOS 16 betas.

If you have a string that contains multiple paragaphs all paragraphs after the first one will be truncated after the first line. This happens even if the markdown string passed to SwiftyMarkdown contains no special markdown formatting.

For example if passed some multi paragraph text it would render like this:

This is the first paragraph were text wraps properly
and lines are not truncated. It can carry on for multiple
lines just fine.

But every paragraph after the first will a its text trun....

And the third paragraph will appear truncated as we...

If you pass the exact same text as an NSAttributedString directly (not using SwiftyMarkdown) then it lays out correctly.

I'm not sure what is causing this as I don't quite understand the inner workings or how attributed strings are built. I don't know if Apple changed something behind the scenes here or if it's just a bug with the beta but it's probably worth looking into.

Thanks

@Hank2354
Copy link

I have the same problem 📛
iOS 16

@Inakitajes
Copy link

Inakitajes commented Oct 4, 2022

Any update on this?

Temp workaround:

  1. Use UITextField instead of UILabel
  2. Use .sizeToFit() after setting the attributed string value if you want to wrap content.

@Hank2354
Copy link

Hank2354 commented Oct 4, 2022

UITextView instead UILabel - also temp workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants