聚光灯

1.WSCoachMarksView2013年的第三方库,比较古老

1.文字、按钮在聚光灯上面(默认在聚光灯下面)

NSArray *coachMarks = @[
@{@"rect": [NSValue valueWithCGRect:(CGRect){{SCREEN_WIDTH/8.0*5-25,SCREEN_HEIGHT-HeightOfTabBar},{50,50.0f}}], @"caption": @"",@"bottomImage":@"我知道了",@"midleImage":@"文字提示-首页",@"positionCaption": @"1"},
];
[self creatSpotlightView:FistHomeSpotlight withArray:coachMarks withSuprView:[UIApplication sharedApplication].keyWindow];

2.在UIViewController中写分类

//聚光灯
- (void)creatSpotlightView:(NSString *)keyString withArray:(NSArray *)coachMarks withSuprView:(UIView *)suprView{
   if (![[NSUserDefaults standardUserDefaults] boolForKey:keyString]) {
       WSCoachMarksView *coachMarksView = [[WSCoachMarksView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)) coachMarks:coachMarks];
       [suprView addSubview:coachMarksView];
       coachMarksView.delegate = self;
       [coachMarksView start];
       [[NSUserDefaults standardUserDefaults] setBool:YES forKey:keyString];
   }
}

3.效果如图所示

Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-22 at 13.58.11.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容