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

UI Hanging Issue while using html string #2095

Open
abbasnaqvi200 opened this issue Oct 9, 2023 · 1 comment
Open

UI Hanging Issue while using html string #2095

abbasnaqvi200 opened this issue Oct 9, 2023 · 1 comment

Comments

@abbasnaqvi200
Copy link

UI Hanging Issue while using html string

DispatchQueue.global(qos : .background).async {

  guard let data = htmlTemplate.data(using: .utf8) else {
       return nil
   }

guard let attributedString = try? NSMutableAttributedString(
  data: data,
  options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue],
  documentAttributes: nil
  ) else {
  return nil
}
DispatchQueue.main.async {
   self.textNode.attributedText = attributedString
}

}

@abbasnaqvi200 abbasnaqvi200 changed the title **UI Hanging Issue while using html string** UI Hanging Issue while using html string Oct 9, 2023
@cendolinside123
Copy link

don't put anything related with html on background thread and async process , html need lot of time to load and it on some case it will cause crash or dirty issue on NSMutableAttributedString

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

2 participants