diff --git a/Classes/GoAutoSlideView.h b/Classes/GoAutoSlideView.h index 2ec0ccb..ed48ff5 100644 --- a/Classes/GoAutoSlideView.h +++ b/Classes/GoAutoSlideView.h @@ -78,6 +78,10 @@ NS_ASSUME_NONNULL_BEGIN * The bottom margin of indicator. */ @property (nonatomic, assign) CGFloat indicatorBottomMargin; +/** + * The page control of the slide view. + */ +@property (nonatomic, strong, readonly) UIPageControl *pageControl; /** * Loads/Reloads the page view of the auto slide view. */ diff --git a/Classes/GoAutoSlideView.m b/Classes/GoAutoSlideView.m index aa9583f..e29ea05 100644 --- a/Classes/GoAutoSlideView.m +++ b/Classes/GoAutoSlideView.m @@ -12,8 +12,6 @@ @interface GoAutoSlideView() @property (nonatomic, strong) NSTimer *slideTimer; -@property (nonatomic, strong) UIPageControl *pageControl; - @property (nonatomic, strong) NSMutableArray *contentViews; @property (nonatomic, strong) UIScrollView *scrollView;; @@ -64,7 +62,7 @@ - (void)resetPageControl{ return; } if (!self.pageControl) { - self.pageControl = [[UIPageControl alloc] init]; + self->_pageControl = [[UIPageControl alloc] init]; self.pageControl.hidesForSinglePage = YES; self.pageControl.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; self.pageControl.center = CGPointMake(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) - (self.indicatorBottomMargin > 0 ? self.indicatorBottomMargin : 20));