Change 'currentPageChanged' to 'currentPageChangedBlock'

This commit is contained in:
Looping 2014-11-02 22:53:01 +08:00
parent 3de11a9c80
commit cc360cc06f
3 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,7 @@ typedef void (^RCCurrentPageChangedBlock)(RCPageControl *pageControl);
@property(nonatomic) UIFont *currentPageIndexTextFont; // default is [UIFont systemFontOfSize:0], the font size is automatically adjusts by the value of indicatorDotWidth and animationScaleFactor
@property (nonatomic, copy) RCCurrentPageChangedBlock currentPageChanged; // if set, -sendActionsForControlEvents will never be called, only available for 'Touch Event' in page control, it also means you need to set non-zero frame for page control to activate 'Touch Event'
@property (nonatomic, copy) RCCurrentPageChangedBlock currentPageChangedBlock; // if set, -sendActionsForControlEvents will never be called, only available for 'Touch Event' in page control, it also means you need to set non-zero frame for page control to activate 'Touch Event'
- (instancetype)initWithNumberOfPages:(NSInteger)pages; // if you want 'currentPageChanged' block available, call -setFrame: after initialization

View File

@ -261,8 +261,8 @@
[self setCurrentPage:self.currentPage + 1 forceRefresh:NO];
}
if (_currentPageChanged) {
_currentPageChanged(self);
if (_currentPageChangedBlock) {
_currentPageChangedBlock(self);
} else {
[self sendActionsForControlEvents:UIControlEventValueChanged];
}

View File

@ -48,7 +48,7 @@
})];
__weak ViewController *weakSelf = self;
[_pageControlRC setCurrentPageChanged:^(RCPageControl *pageControl) {
[_pageControlRC setCurrentPageChangedBlock:^(RCPageControl *pageControl) {
[weakSelf.pageViews scrollToItemAtIndex:pageControl.currentPage animated:YES];
}];
}