This is an automated email from the ASF dual-hosted git repository. moshen pushed a commit to branch double11-fix5 in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
commit cb7fe03233744d34849c92b1cc20be2a5a86e4a8 Author: qianyuan.wqy <[email protected]> AuthorDate: Mon Sep 30 11:16:57 2019 +0800 [iOS] Protect endless iteration when setting index for slider view. --- ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm index 865778c..d3ba26c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm @@ -148,6 +148,10 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)setCurrentIndex:(NSInteger)currentIndex { + if (_currentIndex == currentIndex) { + return; + } + if (currentIndex >= _itemViews.count || currentIndex < 0) { currentIndex = 0; }
