Open yihuds opened 3 years ago
This sounds like an issue with WKWebView
.
I had a similar issue. I found that HTML with a lot of formatting appeared to hang my mac catalyst app, but found it was actually just taking an extremely long time. On debugging the issue I found that the culprit was CYRTextView.h/m which is a subclass of UITextView. It is the class used for the text view of the HTML, sourceView. My local fix was to make sourceView's class UITextView instead of CYRTextView.
// // ZSSTextView.h // ZSSRichTextEditor // // Created by Nicholas Hubbard on 1/29/14. // Copyright (c) 2014 Zed Said Studio. All rights reserved. //
// Fix Issue #010 - "Extremely slow opening note copied/pasted from // web page". Eliminate the syntax formatting of the HTML that was // causing the very slow note loading. Remove CYRTextView subclassing // of UITextView. The "Show Source" tool will now display unformatted, // unsyntaxed HTML. //@interface ZSSTextView : CYRTextView @interface ZSSTextView : UITextView
@property (nonatomic, strong) UIFont defaultFont; @property (nonatomic, strong) UIFont boldFont; @property (nonatomic, strong) UIFont *italicFont;
@end
when we load a HTML with long content, app will become freeze and then killed by iOS system.