From 2ce90b74a736e706175b236094d91f655faf3955 Mon Sep 17 00:00:00 2001 From: Andrei Bouariu Date: Fri, 30 Apr 2021 12:32:00 +0200 Subject: [PATCH] Set page control as a public readonly property --- Classes/GoAutoSlideView.h | 4 ++++ Classes/GoAutoSlideView.m | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) 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));