Change 'currentPageChanged' to 'currentPageChangedBlock'
This commit is contained in:
parent
3de11a9c80
commit
cc360cc06f
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -261,8 +261,8 @@
|
|||
[self setCurrentPage:self.currentPage + 1 forceRefresh:NO];
|
||||
}
|
||||
|
||||
if (_currentPageChanged) {
|
||||
_currentPageChanged(self);
|
||||
if (_currentPageChangedBlock) {
|
||||
_currentPageChangedBlock(self);
|
||||
} else {
|
||||
[self sendActionsForControlEvents:UIControlEventValueChanged];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
})];
|
||||
|
||||
__weak ViewController *weakSelf = self;
|
||||
[_pageControlRC setCurrentPageChanged:^(RCPageControl *pageControl) {
|
||||
[_pageControlRC setCurrentPageChangedBlock:^(RCPageControl *pageControl) {
|
||||
[weakSelf.pageViews scrollToItemAtIndex:pageControl.currentPage animated:YES];
|
||||
}];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue