SimplePagedView 1.0.0

SimplePagedView 1.0.0

Alex Reilly 维护。



SimplePagedView

SimplePagedView 是一个iOS组件,使得设置页面视图变得尽可能简单,例如启动页面或者展示信息。

simulator screen shot - iphone 8 - 2018-12-12 at 12 54 46

安装

pod 'SimplePagedView'

使用方式

// Create a PagedViewController by providing it with a view for each page you'd like it to contain
let pagedViewController = PagedViewController(with:
    LogoView(presenter: welcomePresenter),
    CardPageView(image: ThemeManager.Images.welcomeTourSlide1,
                        subtitle: "Complete and resolve tasks on the go"),
    CardPageView(image: ThemeManager.Images.welcomeTourSlide2,
                        subtitle: "Comment on tasks and conversations"),
    CardPageView(image: ThemeManager.Images.welcomeTourSlide3,
                        subtitle: "Add files and pictures in seconds")
)

// Add the pagedViewController as a child view controller
self.add(pagedViewController) { (childView) -> [NSLayoutConstraint] in
    // Return an array of constraints to apply to the paged view
    return [
        childView.topAnchor.constraint(equalTo: view.readableContentGuide.topAnchor),
        childView.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor),
        childView.trailingAnchor.constraint(equalTo: view.readableContentGuide.trailingAnchor),
        childView.bottomAnchor.constraint(equalTo: view.readableContentGuide.bottomAnchor)
    ]
}