You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/02/02 07:47:16 UTC

incubator-weex git commit: * [iOS] optimize text and waterfall component

Repository: incubator-weex
Updated Branches:
  refs/heads/master b94710984 -> 8c939acbd


* [iOS] optimize text and waterfall component


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8c939acb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8c939acb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8c939acb

Branch: refs/heads/master
Commit: 8c939acbda324b076e29174e2306cf6556101028
Parents: b947109
Author: acton393 <zh...@gmail.com>
Authored: Fri Feb 2 15:46:59 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Feb 2 15:46:59 2018 +0800

----------------------------------------------------------------------
 .../Sources/Component/Recycler/WXRecyclerUpdateController.m      | 4 +++-
 ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m              | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8c939acb/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
index 03e7848..4630d58 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerUpdateController.m
@@ -162,7 +162,9 @@
     if (!self.delegate || !collectionView.dataSource) {
         return;
     }
-    
+    if (![diffResult hasChanges]) {
+        return;
+    }
     WXLogDebug(@"Diff result:%@", diffResult);
     [collectionView performBatchUpdates:updates completion:completion];
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8c939acb/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
index 65f7ae3..3dcc827 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -382,6 +382,9 @@ do {\
 
 - (NSAttributedString *)ctAttributedString
 {
+    if (!self.text) {
+        return nil;
+    }
     NSAttributedString * attributedString = nil;
     pthread_mutex_lock(&(_ctAttributedStringMutex));
     if (!_ctAttributedString) {