UIPages 0.1.11

UIPages 0.1.11

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年6月

Christopher Miller维护。



UIPages 0.1.11

  • 作者:
  • Christopher Miller

Pages Controller iOS

UIPages 是 UIKit 类 UIPageViewController 的包装框架。每个页面组件通过 UIPagesDataSource 提供,用于与相关的故事板交互。UIPagesDataSource 类允许我们遍历故事板组件,并在遍历过程中保持当前索引。

设置

安装

UIPages 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中即可

pod "UIPages"

定义页面

define

将您的控制器添加到故事板中,然后更新“Storyboard ID”

assign

更新“Storyboard ID”后,您可以在UIPagesDataSource中引用控制器

#import "WalkthroughController.h"

@interface WalkthroughController () <UIPagesDataSource>
@end

@implementation WalkthroughController
-(NSString*)getStoryboardName {
    return @"Walkthrough";
}
-(NSArray*)getIdentifiers {
    return @[@"suggestions"];
}
@end

之后可在Swift中定义UIPagesDataSource

class WalkthroughController : UIPagesDataSource {
    func getStoryboardName() -> String {
        return "Walkthrough"
    }

    func getIdentifiers() -> [AnyObject] {
        return ["suggestions"]
    }
}

示例项目

PagesObjCExamples项目有6个屏幕在Walkthrough故事板和控制器中引用。为了演示在应用程序第一次启动时滑动操作将如何工作,此示例使用UISwipes框架。

storyboard

suggestions swipes

上述是(六个)Walkthrough屏幕中的两个,显示了如何将演示集成到您的应用程序引导流程中。

要运行示例项目,请克隆仓库,然后从示例目录中首先运行pod install

git clone https://github.com/the-mac/pages-controller-ios.git
cd PagesObjCExamples
pod install
open PagesObjCExamples.xcworkspace

要求

对于您自己的项目(和Podfile),我们的UIPages引用可能如下所示

platform :ios, '8.0'
target 'MyAppTarget' do
    pod 'UIPages'
end

许可证

UIPages 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。