崩溃日志:
'Could not instantiate class named _UITextLayoutView because no class named _UITextLayoutView was found;
解决方案:方案来自Stack Overflow
新建一个类MZUITextViewWorkaround
+ (void)executeWorkaround {
if (@available(iOS 13.2, *)) {
}
else {
const char *className = "_UITextLayoutView";
Class cls = objc_getClass(className);
if (cls == nil) {
cls = objc_allocateClassPair([UIView class], className, 0);
objc_registerClassPair(cls);
#if DEBUG
printf("added %s dynamically\n", className);
#endif
}
}
}
在AppDelegate里调用:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[MZUITextViewWorkaround executeWorkaround];
return YES;
}
网友评论