每一次的版本更新都需要对应内容的新的引导页来展示,如果你看看厌了单调的拖动换页,不妨来试试<code>TMM_NewfeaturesController</code> 这是一个简单的新性效视图,使用起来非常简单,只需要几行代码,即可搞定。
效果
![image](https://github.com/MethodName/TMM_Newfeatures/raw/master/2016-05-19%2011_43_22.gif)
使用
新特效的页面一般会在程序更新版本后,第一次进入就会展现出来,那么这就需要在<code>AppDelegate</code>中的<code>didFinishLaunchingWithOptions</code>方法中加以判断是否是第一次进入程序,然后在进行切换<code>rootViewController</code>为新特性视图。
这个时候我们需要将原来的<code>rootViewController</code>保存起来,等新特效视图切换完成后,再将原来的<code>rootViewController</code>切换回来,大体的使用如下:
<pre><code class='hljs objc'>
import "AppDelegate.h"
import "TMM_NewfeaturesController.h"
@interface AppDelegate ()<WelcomeDelegate>
/**
- 默认根视图
*/
@property(nonatomic,strong)UIViewController *defaultRootVC;
@end
@implementation AppDelegate
-
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions
{
//保存原本的rootVC
self.defaultRootVC = self.window.rootViewController;
/-
判断是否第一次进入程序
*/
if (1==1)
{
TMM_NewfeaturesController *welcomeVC = [[TMM_NewfeaturesController alloc]init];
[welcomeVC.view setFrame:self.window.bounds];
[welcomeVC setImageNames:@[@"1",@"2",@"3"]];//设置图片数组
[welcomeVC setCompleteDelegate:self];//设置代理//设置新特性页面为rootVC
[self.window setRootViewController:welcomeVC];
}
return YES;
} -
/**
- 欢迎页完成
*/
-(void)welcomeOK
{
//切回原来的rootVC
[self.window setRootViewController:self.defaultRootVC];
}
</code></pre>
附上github地址:<i class="am-icon-github"></i>TMM_Newfeatures
希望能帮助到大家。(PS:求小星星)