源码:http://files.cnblogs.com/ios8/%5Bcode4app.com%5DIntroductionTutorialView_10843.zip

可以看看demo,很简单,我也是一看就懂。

下面说说我整合到我的项目中的方法。

1.把下载的demo中的

MYIntroductionView.h    

MYIntroductionView.m

MYIntroductionPanel.h

MYIntroductionPanel.m

这四个文件,再加上一些图像资源加到你的工程中去。(之后如果要修改图像等资源只要在相应位置修改就好了。这里只是师范,没做修改)。

2.在你的主界面(打开应用显示的第一个界面)

在对应的.h文件中引入头文件并且设置协议。

如我的是  mainView.h

  1. //
  2. //  mainView.h
  3. //  softwareApp
  4. //
  5. //  Created by 余龙泽 on 13-9-27.
  6. //  Copyright (c) 2013年 余龙泽. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "MYIntroductionView.h"
  10. @interface mainView : UITabBarController<MYIntroductionDelegate>
  11. @end

3.在主界面对应的.m文件中加入如下代码。

如我的mainView.m

  1. -(void)viewDidAppear:(BOOL)animated{
  2. //读取沙盒数据
  3. NSUserDefaults * settings1 = [NSUserDefaults standardUserDefaults];
  4. NSString *key1 = [NSString stringWithFormat:@"is_first"];
  5. NSString *value = [settings1 objectForKey:key1];
  6. if (!value)  //如果没有数据
  7. {
  8. //STEP 1 Construct Panels
  9. MYIntroductionPanel *panel = [[MYIntroductionPanel alloc] initWithimage:[UIImage imageNamed:@"SampleImage1"] description:@"Welcome to MYIntroductionView, your 100 percent customizable interface for introductions and tutorials! Simply add a few classes to your project, and you are ready to go!"];
  10. //You may also add in a title for each panel
  11. MYIntroductionPanel *panel2 = [[MYIntroductionPanel alloc] initWithimage:[UIImage imageNamed:@"SampleImage2"] title:@"Your Ticket!" description:@"MYIntroductionView is your ticket to a great tutorial or introduction!"];
  12. //STEP 2 Create IntroductionView
  13. /*A standard version*/
  14. //MYIntroductionView *introductionView = [[MYIntroductionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) headerImage:[UIImage imageNamed:@"SampleHeaderImage.png"] panels:@[panel, panel2]];
  15. /*A version with no header (ala "Path")*/
  16. //MYIntroductionView *introductionView = [[MYIntroductionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) panels:@[panel, panel2]];
  17. /*A more customized version*/
  18. MYIntroductionView *introductionView = [[MYIntroductionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) headerText:@"MYIntroductionView" panels:@[panel, panel2] languageDirection:MYLanguageDirectionLeftToRight];
  19. [introductionView setBackgroundImage:[UIImage imageNamed:@"SampleBackground"]];
  20. //Set delegate to self for callbacks (optional)
  21. introductionView.delegate = self;
  22. //STEP 3: Show introduction view
  23. [introductionView showInView:self.view];
  24. //写入数据
  25. NSUserDefaults * setting = [NSUserDefaults standardUserDefaults];
  26. NSString * key = [NSString stringWithFormat:@"is_first"];
  27. [setting setObject:[NSString stringWithFormat:@"false"] forKey:key];
  28. [setting synchronize];
  29. }
  30. }

代码不难。

viewDidAppear是在视图即将显示时候调用的方法。 这里看头寻找沙盒中 is_first中是否有数据,如果没有,就说明是第一次运行程序,则显示引导页并且在沙盒对应位置写入数据。

如果有数据,就说明不是第一次运行,则跳过,不显示引导页。  

 

很简单的操作。当然有更好的方法,也有更好的类库,这只是我个人选择的方法罢了。

ios开发-引导页实现的更多相关文章

  1. iOS App引导页功能实现

    一.写作原因 以前都没有想着来写点东西,今天遇到件事情让我决定每次还是要做记录.因为以前自己可以轻松的完成pod spec的配置,但是今天在做的时候还是忘了遇到了很多坑.pod spec配置遇到的坑不 ...

  2. [iOS] App引导页的简单实现 (Swift 2)

    转载请注明出处:http://www.jianshu.com/p/024dd2d6e6e6# 已更新至 Xcode7.2.Swift2.1 在第一次打开App或者App更新后通常用引导页来展示产品特性 ...

  3. iOS:判断引导页首次出现、版本更新

    判断引导页首次出现方式: //选择根控制器 +(void)chooseRootViewController{ //初始化Window窗口 [AppDelegate Delegate].window = ...

  4. iOS透明引导页

    一.效果展示 这里写图片描述 这种类型的新手引导比较常见,用于告诉用户某个按钮的作用,或者提醒用户可以进行某种交互操作.引导样式是在界面上加了一个半透明的引导图,高亮部分就是要突出的区域 二.怎么做? ...

  5. Sagit.Framework For IOS 开发框架入门开发教程2:一行代码实现引导页

    前言: 开篇比较简单:Sagit.Framework For IOS 开发框架入门开发教程1:框架下载与环境配置 第二篇教程之前写了一半,感觉不太好写,而且内容单纯介绍API,要说的很多,又枯燥乏味. ...

  6. 用Flutter开发的跨平台项目,完美运行在Android和IOS上,Material简洁风格,包括启动页、引导页、注册、登录、首页、体系、公众号、导航、项目,还有漂亮的妹子图库,运行极度流畅,结构清晰,代码规范,值得拥有

    Flutter学习资源汇总持续更新中...... Flutter官方网站 Flutter中文网 wendux的Flutter实战 Flutter官方exampleflutter_gallery 阿里巴 ...

  7. iOS开发笔记(Swift)-通用App安装引导页的实现

    之前一直做的项目都是基于OC开发的,最近开始尝试使用Swift语言来重写整个项目. 本篇文章主要是讲述如何使用Swift来实现常见的通用App安装引导界面. 效果预览: 实现思路: 主要是采用了UIS ...

  8. IOS开发小功能1:引导页的开发

    效果图如上,实现的是一个页面引导页,最后跳到主页面,主页面是一个navigationController,但是导航栏给我隐藏了. 文件目录:自己定制的viewcontroller以及navigatio ...

  9. iOS - GitHub干货分享(APP引导页的高度集成 - DHGuidePageHUD - ②)

    距上一篇博客"APP引导页的高度集成 - DHGuidePageHUD - ①"的发布有一段时间了, 后来又在SDK中补充了一些新的内容进去但是一直没来得及跟大家分享, 今天来跟大 ...

随机推荐

  1. secureCRT,永久设置,保护眼睛,配色方案

    配色后效果如下: 下面开始配色 1.选项(Options)==>会话选项(Sessions options)==>终端(Terminal)==>仿真(Emulation) 按图中标注 ...

  2. MySQL优化系列

    https://blog.csdn.net/Jack__Frost/article/details/73347688

  3. 【Java】监控远程服务器JVM

    今天在用JMeter进行测试的时候,发现线程并发量到50的时候会导致阻塞情况,于是需要监控远程JVM,那么如何监控远程JVM呢? 首先,找到启动计量引擎的sh文件,例如我目前的计量引擎启停文件为str ...

  4. python之模块py_compile用法(将py文件转换为pyc文件)

    # -*- coding: cp936 -*- #python 27 #xiaodeng #python之模块py_compile用法(将py文件转换为pyc文件):二进制文件,是由py文件经过编译后 ...

  5. 转:OGRE 源码编译方法

    编译及运行环境:Windows 7 . vs2010. 编译前的准备: 1.想编译OGRE,最起码要有OGRE的源码吧.可以去官方网站下载最新的源码包,我这里用的是1.7.2版本的,下载下来的文件叫 ...

  6. 【DM】Combating Web Spam with TrustRank - 用TrustRank对抗网络垃圾邮件

    [论文标题]Combating Web Spam with TrustRank (Proceedings 2004 VLDB Conference) [论文作者]Zolt´an Gy¨ongyi,He ...

  7. java mongodb 基础系列---查询,排序,limit,$in,$or,输出为list,创建索引,$ne 非操作

    官方api教程:http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/#getting-started ...

  8. 自动化部署必备技能—定制化RPM包

    回顾下安装软件的三种方式: 1.编译安装软件,优点是可以定制化安装目录.按需开启功能等,缺点是需要查找并实验出适合的编译参数,诸如MySQL之类的软件编译耗时过长. 2.yum安装软件,优点是全自动化 ...

  9. Redis学习之路(007)- Redis学习手册(实例代码)

    在之前的博客中已经非常详细的介绍了Redis的各种操作命令.运行机制和服务器初始化参数配置.本篇博客是该系列博客中的最后一篇,在这里将给出基于Redis客户端组件访问并操作Redis服务器的代码示例. ...

  10. Redis学习之路(003)- hiredis安装及测试

    一. hiredis下载地址及C API  github下载:https://github.com/redis/hiredis 安装脚本: #!/bin/zsh git clone https://g ...