From 6b1040b8a2d13e60a9fbedc47ba201ea79cfd3c1 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 12 Jun 2020 11:13:55 +0800 Subject: [PATCH] feat:fix ListNode crash on iOS 10 and iOS 11 --- doric-iOS/Example/Example/Info.plist | 26 ++++++++++---------- doric-iOS/Pod/Classes/Shader/DoricListNode.m | 8 +++--- doric-js/bundle/doric-sandbox.es5.js | 14 ++--------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/doric-iOS/Example/Example/Info.plist b/doric-iOS/Example/Example/Info.plist index c45fd85c..c7301eb1 100644 --- a/doric-iOS/Example/Example/Info.plist +++ b/doric-iOS/Example/Example/Info.plist @@ -2,8 +2,6 @@ - NSCameraUsageDescription - Scan QR Code CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -20,8 +18,21 @@ 1.0 CFBundleVersion 1 + LSApplicationCategoryType + LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSCameraUsageDescription + Scan QR Code + UIAppFonts + + iconfont.ttf + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -36,13 +47,6 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - LSApplicationCategoryType - UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait @@ -52,9 +56,5 @@ UIViewControllerBasedStatusBarAppearance - UIAppFonts - - iconfont.ttf - diff --git a/doric-iOS/Pod/Classes/Shader/DoricListNode.m b/doric-iOS/Pod/Classes/Shader/DoricListNode.m index 8b697368..33223005 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricListNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricListNode.m @@ -226,9 +226,11 @@ - (void)callItem:(NSUInteger)position height:(CGFloat)height { self.itemHeights[@(position)] = @(height); NSIndexPath *indexPath = [NSIndexPath indexPathForRow:position inSection:0]; if (@available(iOS 10.0, *)) { - [UIView performWithoutAnimation:^{ - [self.view reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone]; - }]; + dispatch_async(dispatch_get_main_queue(), ^{ + [UIView performWithoutAnimation:^{ + [self.view reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone]; + }]; + }); } else { dispatch_async(dispatch_get_main_queue(), ^{ [self.view reloadData]; diff --git a/doric-js/bundle/doric-sandbox.es5.js b/doric-js/bundle/doric-sandbox.es5.js index 5ca3296c..66ad4758 100644 --- a/doric-js/bundle/doric-sandbox.es5.js +++ b/doric-js/bundle/doric-sandbox.es5.js @@ -59,18 +59,8 @@ var doric = (function (exports) { var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); - } - }, fn(module, module.exports), module.exports; - } - - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; } /*! *****************************************************************************