[翻译] ABCIntroView

本文介绍了一个简单易用的iOS应用引导页组件ABCIntroView。通过几个简单的步骤即可将其集成到项目中,帮助用户了解应用的基本功能。文章详细说明了如何添加必要的文件、配置属性及实现显示逻辑。

ABCIntroView

ABCIntroView is an easy to use onboarding which allows you to introduce your users to the applicaiton before reaching the Main Screen.

ABCIntroView是一个简单易用的引导页。

To use the ABCIntroView please do the following:

你需要遵循以下几步来使用它:

  1. Add the follwing files found in the CLASSES folder to your project: 将以下几个文件拖到你的项目当中:
        *ABCIntroView.h
        *ABCIntroView.m
  1. Import the ABCIntoView file to your RootViewController. 将ABCIntoView文件引入到你的RootViewController当中。

  2. Create an ABCIntroView property and add the ABCIntroViewDelegate. 创建ABCIntroView属性以及添加ABCIntroViewDelegate代理。

  3. Add the following line of code to your ViewDidLoad: 然后将以下代码添加到你的ViewDidLoad:方法中。

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if (![defaults objectForKey:@"intro_screen_viewed"]) {
        self.introView = [[ABCIntroView alloc] initWithFrame:self.view.frame];
        self.introView.delegate = self;
        self.introView.backgroundColor = [UIColor greenColor];
        [self.view addSubview:self.introView];  
    }
  1. Add the ABCIntroView Delegate Method: 添加ABCIntroView代理方法
#pragma mark - ABCIntroViewDelegate Methods

-(void)onDoneButtonPressed{
    //    Uncomment so that the IntroView does not show after the user clicks "DONE"
    //    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]
    //    [defaults setObject:@"YES"forKey:@"intro_screen_viewed"];
    //    [defaults synchronize];
    [UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        self.introView.alpha = 0;
    } completion:^(BOOL finished) {
        [self.introView removeFromSuperview];
    }];
}

If you have any questions about the project, please don't hesitate to ask.

如果有任何关于项目的疑问,不吝赐教。

Enjoy! :)

Adam

 

转载于:https://www.cnblogs.com/YouXianMing/p/4372931.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值