单军华
2018-07-11 7b02207537d35bfa1714bf8beafc921f717d100a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
//  LMJIntroductoryPagesHelper.m
//  iOSProject
//
//  Created by windshan on 2017/12/29.
//  Copyright © 2017年 windshan. All rights reserved.
//
 
#import "LMJIntroductoryPagesHelper.h"
#import "LMJIntroductoryPagesView.h"
 
@interface LMJIntroductoryPagesHelper ()
 
@property (weak, nonatomic) UIWindow *curWindow;
 
@property (strong, nonatomic) LMJIntroductoryPagesView *curIntroductoryPagesView;
 
@end
 
@implementation LMJIntroductoryPagesHelper
 
static LMJIntroductoryPagesHelper *shareInstance_ = nil;
+ (instancetype)shareInstance
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        shareInstance_ = [[LMJIntroductoryPagesHelper alloc] init];
    });
    
    return shareInstance_;
}
 
+ (void)showIntroductoryPageView:(NSArray<NSString *> *)imageArray
{
    if (![LMJIntroductoryPagesHelper shareInstance].curIntroductoryPagesView)
    {
        [LMJIntroductoryPagesHelper shareInstance].curIntroductoryPagesView = [LMJIntroductoryPagesView pagesViewWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight) images:imageArray];
    }
    
    [LMJIntroductoryPagesHelper shareInstance].curWindow = [UIApplication sharedApplication].keyWindow;
    [[LMJIntroductoryPagesHelper shareInstance].curWindow addSubview:[LMJIntroductoryPagesHelper shareInstance].curIntroductoryPagesView];
}
 
@end