LAWalkthrough 1.0.0

LAWalkthrough 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后版本2014年12月

未声明维护。



  • 作者:
  • Larry Aasen

LAWalkthrough是为iOS设计的视图控制器类,旨在简化walkthrough设计模式的创建。此代码于2013年4月受到Mari Sheibley在http://www.mobile-patterns.com/walkthroughs上显示的屏幕截图的启发。

它使用起来很简单,并且实现一个看起来不错的walkthrough需要非常少的代码。它使用UIPageControl和UIScrollView,并且易于子类化进行定制。

入门指南

示例使用

以文本视图和背景图片显示walkthrough

// Create the walkthrough view controller
LAWalkthroughViewController *walkthrough = LAWalkthroughViewController.new;
walkthrough.view.frame = self.view.frame;
walkthrough.backgroundImage = [UIImage imageNamed:@"tour-bg@2x"];

// Create pages of the walkthrough
[walkthrough addPageWithBody:@"Take a tour of this app."];
[walkthrough addPageWithBody:@"Thanks for taking this tour."];

// Use the default next button
walkthrough.nextButtonText = nil;

// Add the walkthrough view to your view controller's view
[self addChildViewController:walkthrough];
[self.view addSubview:walkthrough.view];

示例的屏幕截图
LAWalkthrough

以XIB视图和背景图片显示walkthrough

// Create the walkthrough view controller
LAWalkthroughViewController *walkthrough = LAWalkthroughViewController.new;
walkthrough.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-50);
walkthrough.backgroundImage = [UIImage imageNamed:@"tour-bg1@2x"];

// Create pages of the walkthrough from XIBs
[walkthrough addPageWithNibName:@"TourView1" bundle:nil]; // no need for a view controller
[walkthrough addPageWithNibName:@"TourView2" bundle:nil]; // no need for a view controller
[walkthrough addPageWithNibName:@"TourView3" bundle:nil]; // no need for a view controller

// Use text for the next button
walkthrough.nextButtonText = @"Next >";

// Add the walkthrough view to your view controller's view
[self addChildViewController:walkthrough];
[self.view addSubview:walkthrough.view];

示例的屏幕截图
LAWalkthrough

要求

从LAWalkthrough 1.0开始需要iOS 6.0以上。

ARC

自1.0版发布以来,LAWalkthrough使用ARC。

如果您正在您的非ARC项目中使用LAWalkthrough 1.0,您需要在所有LAWalkthrough源文件上设置一个-fobjc-arc编译器标志。

要在Xcode中设置编译器标志,请转到您的活动目标并选择“构建阶段”选项卡。现在选择所有LAWalkthrough源文件,按Enter,插入-fobjc-arc-fno-objc-arc,然后“完成”以启用或禁用LAWalkthrough的ARC。

致谢

LAWalkthrough是在开发Konugo for iPhone时由Larry Aasen创建的。

联系

在Twitter上关注LAWalkthrough和Konugo (@Konugo)

作者

Larry Aasen
@larryaasen

许可证

LAWalkthrough采用MIT许可证发布。更多信息请参阅LICENSE文件。