Xcode 11 Xib _UITextLayoutView
崩溃
崩溃信息如下:
*** Terminating app due to uncaught exception
'NSInvalidUnarchiveOperationException',
reason: 'Could not instantiate class named _UITextLayoutView because no class named _UITextLayoutView was found;
the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)'
解决方案:
解决方案 一
xib的部分视图改用硬核手写,以避坑。
解决方案 二
解决方案 三
OC 黑魔法 Runtime。
创建 文件 UITextViewWorkaround
UITextViewWorkaround.h
#import <Foundation/Foundation.h>
@interface UITextViewWorkaround : NSObject
+ (void)executeWorkaround;
@end
UITextViewWorkaround.m