check before use

This commit is contained in:
Pfeil, Scott Robert 2019-08-01 09:23:10 -04:00
parent 245d7d93d6
commit 7bb6e5ba8d

View File

@ -297,9 +297,11 @@ static CGFloat const IndicatorRectangleHeight = 4;
if (selectedIndex != NSNotFound) { if (selectedIndex != NSNotFound) {
self.currentPage = selectedIndex; self.currentPage = selectedIndex;
[self sendActionsForControlEvents:UIControlEventValueChanged]; [self sendActionsForControlEvents:UIControlEventValueChanged];
if (self.pagingTouchBlock) {
self.pagingTouchBlock(self); self.pagingTouchBlock(self);
} }
} }
}
} }
#pragma mark - MVMCoreUIPagingProtocol #pragma mark - MVMCoreUIPagingProtocol
@ -351,8 +353,10 @@ static CGFloat const IndicatorRectangleHeight = 4;
if ((index < self.numberOfPages && index >= 0) || self.alwaysSendingControlEvent) { if ((index < self.numberOfPages && index >= 0) || self.alwaysSendingControlEvent) {
[self setCurrentPage:index animated:NO]; [self setCurrentPage:index animated:NO];
[self sendActionsForControlEvents:UIControlEventValueChanged]; [self sendActionsForControlEvents:UIControlEventValueChanged];
if (self.pagingTouchBlock) {
self.pagingTouchBlock(self); self.pagingTouchBlock(self);
} }
}
} }
#pragma mark - Animate pagecontrol indicator #pragma mark - Animate pagecontrol indicator