- (void)updateDots{
for (int i = 0; i < [self.subviews count]; i++) {
UIView *view = [self.subviews objectAtIndex:i];
UIView *_UIPageControlContentView;
UIView *_UIPageControlIndicatorContentView;
NSString *className = NSStringFromClass([view class]);
if ([className isEqualToString:@"_UIPageControlContentView"]) {
_UIPageControlContentView = view;
for (UIView *contentView in _UIPageControlContentView.subviews) {
NSString *className = NSStringFromClass([contentView class]);
if ([className isEqualToString:@"_UIPageControlIndicatorContentView"]) {
_UIPageControlIndicatorContentView = contentView;
}
}
}
for (int n = 0; n < _UIPageControlIndicatorContentView.subviews.count; n ++) {
UIImageView *dot = [self imageViewForSubview:[_UIPageControlIndicatorContentView.subviews objectAtIndex:n] currPage:n];
if (n == self.currentPage){
dot.image = self.currentImage;
dot.size = self.currentImageSize;
dot.alpha = 1;
}else{
dot.image = self.inactiveImage;
dot.size = self.inactiveImageSize;
dot.alpha = 0.5;
}
[dot styleWithCornerRadius:2.0];
}
}
}
- (UIImageView *)imageViewForSubview:(UIView *)view currPage:(int)currPage{
UIImageView *dot = (UIImageView *)view;
dot.backgroundColor = UIWHITE;
return dot;