Skip to content

Commit

Permalink
修复手动拖动图片时didScrollToIndex:代理方法返回index不准确问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gsdios committed Apr 21, 2016
1 parent ac1e2f3 commit 484ed11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions SDCycleScrollView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Pod::Spec.new do |s|


s.name = "SDCycleScrollView"
s.version = "1.62"
s.summary = "简单易用的图片无限轮播器. 1.62版本升级内容:增加垂直滚动接口;修复部分bug"
s.version = "1.63"
s.summary = "简单易用的图片无限轮播器. 1.63版本修复内容:修复自定义图片的pagecontrol刷新图片数据时崩溃bug;设置单张图片时停止轮播"

s.homepage = "https://github.com/gsdios/SDCycleScrollView"

Expand All @@ -15,7 +15,7 @@ s.platform = :ios
s.platform = :ios, "7.0"


s.source = { :git => "https://github.com/gsdios/SDCycleScrollView.git", :tag => "1.62"}
s.source = { :git => "https://github.com/gsdios/SDCycleScrollView.git", :tag => "1.63"}


s.source_files = "SDCycleScrollView/Lib/SDCycleScrollView/**/*.{h,m}"
Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ typedef enum {

@property (nonatomic, weak) id<SDCycleScrollViewDelegate> delegate;

/** block监听点击方式 */
/** block方式监听点击 */
@property (nonatomic, copy) void (^clickItemOperationBlock)(NSInteger currentIndex);

/** block方式监听滚动 */
@property (nonatomic, copy) void (^itemDidScrollOperationBlock)(NSInteger currentIndex);



////////////////////// 自定义样式接口 //////////////////////
Expand Down
6 changes: 6 additions & 0 deletions SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,10 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
if (self.autoScroll) {
[self setupTimer];
}
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
[self scrollViewDidEndScrollingAnimation:self.mainView];
}

Expand All @@ -603,6 +607,8 @@ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView

if ([self.delegate respondsToSelector:@selector(cycleScrollView:didScrollToIndex:)]) {
[self.delegate cycleScrollView:self didScrollToIndex:indexOnPageControl];
} else if (self.itemDidScrollOperationBlock) {
self.itemDidScrollOperationBlock(indexOnPageControl);
}
}

Expand Down

0 comments on commit 484ed11

Please sign in to comment.