Skip to content

UI Hanging Issue while using html string #2095

Open

Description

@abbasnaqvi200

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
}

}

Activity

  1. changed the title [-]**UI Hanging Issue while using html string**[/-] on Oct 9, 2023
  2. cendolinside123 commented on Feb 15, 2024

    @cendolinside123

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions