From 427f360da15e6b1b3eac797791fb903d487ac13c Mon Sep 17 00:00:00 2001 From: "jiangzenghui005@163.com" Date: Thu, 9 Nov 2017 13:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AC=A2=E8=BF=8E=E9=A1=B5=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LaunchIntroduction/LaunchIntroductionView.m | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ZYGLaunchIntroductionDemo/LaunchIntroduction/LaunchIntroductionView.m b/ZYGLaunchIntroductionDemo/LaunchIntroduction/LaunchIntroductionView.m index 85b7041..73fa11f 100644 --- a/ZYGLaunchIntroductionDemo/LaunchIntroduction/LaunchIntroductionView.m +++ b/ZYGLaunchIntroductionDemo/LaunchIntroduction/LaunchIntroductionView.m @@ -23,14 +23,13 @@ @implementation LaunchIntroductionView BOOL isScrollOut;//在最后一页再次滑动是否隐藏引导页 CGRect enterBtnFrame; NSString *enterBtnImage; -static LaunchIntroductionView *launch = nil; NSString *storyboard; #pragma mark - 创建对象-->>不带button +(instancetype)sharedWithImages:(NSArray *)imageNames{ images = imageNames; isScrollOut = YES; - launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; + LaunchIntroductionView *launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; launch.backgroundColor = [UIColor whiteColor]; return launch; } @@ -41,7 +40,7 @@ +(instancetype)sharedWithImages:(NSArray *)imageNames buttonImage:(NSString *)bu isScrollOut = NO; enterBtnFrame = frame; enterBtnImage = buttonImageName; - launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; + LaunchIntroductionView *launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; launch.backgroundColor = [UIColor whiteColor]; return launch; } @@ -50,7 +49,7 @@ + (instancetype)sharedWithStoryboardName:(NSString *)storyboardName images:(NSAr images = imageNames; storyboard = storyboardName; isScrollOut = YES; - launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; + LaunchIntroductionView *launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; launch.backgroundColor = [UIColor whiteColor]; return launch; } @@ -61,7 +60,7 @@ + (instancetype)sharedWithStoryboard:(NSString *)storyboardName images:(NSArray enterBtnFrame = frame; storyboard = storyboardName; enterBtnImage = buttonImageName; - launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; + LaunchIntroductionView *launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; launch.backgroundColor = [UIColor whiteColor]; return launch; } @@ -194,4 +193,10 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS } } +- (void)dealloc +{ + [self removeObserver:self forKeyPath:@"currentColor"]; + [self removeObserver:self forKeyPath:@"nomalColor"]; +} + @end