Pages is the easiest way of setting up a UIPageViewController

Related tags

UI Pages
Overview

⚠️ DEPRECATED, NO LONGER MAINTAINED

Pages logo

CI Status Version Carthage Compatible Swift License Platform

Pages is the easiest way of setting up a UIPageViewController. It comes with some convenience methods like, disabling swipe, going to a specific page and navigating backwards and forwards. And best of all, you don't have to make your own custom UIViewController to keep an index, Pages handles that for you. It just works.

Usage

let viewController1 = UIViewController()
viewController1.title = "Controller A"

let viewController2 = UIViewController()
viewController2.title = "Controller B"

let pages = PagesController([viewController1, viewController2])

Demo

untitled

Installation

Pages is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Pages'

Pages is also available through Carthage. To install just write into your Cartfile:

github "hyperoslo/Pages"

Author

Hyper, [email protected]

License

Pages is available under the MIT license. See the LICENSE file for more info.

Comments
  • Subclassing

    Subclassing

    PagesController is a subclass of UIPageViewController and we make the things I don't really like: it's delegate and dataSource of self. I think it's better approach to make it a subclass of UIViewController and have a property of UIPageViewController. What do you guys think @zenangst @3lvis @kostiakoval ?

    opened by vadymmarkov 13
  • Add closure for handling page change

    Add closure for handling page change

    We need to handle page change in subclasses (like PresentationController), but it's not good to occupy pagesDelegate which could be needed during the actual usage.

    opened by vadymmarkov 6
  • Add public props for customize colors of UIPageControl

    Add public props for customize colors of UIPageControl

    Add 3 props:

    public var pageControlBackgoundColor: UIColor?
    public var pageIndicatorTintColor: UIColor?
    public var currentPageIndicatorTintColor: UIColor?
    
    opened by kiokumicu 3
  • More concrete example

    More concrete example

    Hi there, I am intrigued by the simplicity of the example shown in the README. But I'm at a loss as to how to implement any of this. All the example says is to do this:

    let viewController1 = UIViewController()
    viewController1.title = "Controller A"
    
    let viewController2 = UIViewController()
    viewController2.title = "Controller B"
    
    let pages = PagesController([viewController1, viewController2])
    

    Which left to our own wits, I have no idea where to put this code, or initialize it, anything. I've imported the library into my project. Created 3 ViewControllers (all through the storyboard) and associated them with their appropriate classes in code.

    See below of the setup.

    // is initial view controller
    class Start: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
        }
        override func viewDidAppear(animated: Bool) {
            let viewController1 = First()
            let viewController2 = Second()
            let pages = PagesController([viewController1, viewController2])
        }
    }
    
    class First: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
        }
    }
    
    class Second: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
        }
    }
    

    All I get is a black screen.

    opened by ded 3
  • Page remains black

    Page remains black

    Using the code:

    let viewController1 = Tutorial_1_ViewController()
    let viewController2 = Tutorial_2_ViewController()
    let pages = PagesController([viewController1, viewController2])
    self.presentViewController(pages, animated: true, completion: nil)
    

    pages is displayed, but the page is just black and doesn't allow scrolling. Showing each of the viewControllers individually works correctly so it isn't an issue with them.

    Any ideas?

    Thanks for the Class though :)

    opened by byroncoetsee 3
  • Xcode 10

    Xcode 10

    Hello,

    I got the following error with XCODE 10:

    :0: error: fatal error encountered while reading from module 'Pages'; please file a bug report with your project and the crash log :0: note: compiling as Swift 4.2, with 'Pages' built as Swift 4.1.50 (this is supported but may expose additional compiler issues)

    1. While running pass #1 SILModuleTransform "PerformanceSILLinker".
    2. While deserializing SIL vtable for 'PagesController' in module 'Pages' error: Abort trap: 6
    opened by hgado11 2
  • pages outside of startPage property still accessible even after setting property

    pages outside of startPage property still accessible even after setting property

    Since startPage is a public property on PagesViewController, I assume that it's meant to be available to developers to change and enforce a start page during runtime?

    I noticed that when your currentIndex = 0 and if you set startPage to 1, the page at index 0 is still accessible as usual.

    Not sure if it's a behaviour worth considering adding but I've created quick PR #39 to fix that

    opened by jurvis 2
  • Swift 4.2 compatibility

    Swift 4.2 compatibility

    Hi there! I've updated Pages to be compatible with Xcode 10 and Swift 4.2 and bumped the pod version up. Please let me know if any question, and would love to get this merged asap!

    Thanks, Alex

    opened by alexasfb 1
  • Navigating to UIViewController from UIpPageViewController

    Navigating to UIViewController from UIpPageViewController

    I have been trying to implement UIPageViewController in my App. After trying conventional UIPageViewController now I am trying yours and everything goes as I wish but one thing is making me crazy . I need paging to happen after user taps a signup button and it okay I had e managed to make it and to the current problem I am facing , There is four pages(UIViewController) for paging when the user reaches the 4th page and after on swipe I need to jump to a ViewController which is not part of Paging. I have done it using Next button click but on swipe I didn't get it right. is it possible using swipe ?

    opened by NuelNikhil 1
  • prevent pages outside of startPage to be accessible after property has been set

    prevent pages outside of startPage to be accessible after property has been set

    referencing: #40

    I've added code that does two things:

    1. On startPage's didSet observer, run goTo(startPage) if the user's currentIndex is less than startPage
    2. Check that parameter index is more than startPage when goTo(index: Int) gets called
    opened by jurvis 1
Releases(2.0.2)
Owner
HyperRedink
Connected creativity
HyperRedink
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI.

BetterSafariView A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI. Contents Motivation Requirements U

Dongkyu Kim 392 Dec 31, 2022
Fashion is your helper to share and reuse UI styles in a Swifty way.

Fashion is your helper to share and reuse UI styles in a Swifty way. The main goal is not to style your native apps in CSS, but use a set

Vadym Markov 124 Nov 20, 2022
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 4, 2023
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

Features • Guides • Installation • Usage • Miscellaneous • Contributing ?? README is available in other languages: ???? . ???? . ???? . ???? . ???? To

Juanpe Catalán 11.7k Jan 6, 2023
Custom emojis are a fun way to bring more life and customizability to your apps.

Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Di

Stream 244 Dec 11, 2022
Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.

Twinkle ✨ Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle. This library creates several CAEmitterLayers and animate

patrick piemonte 600 Nov 24, 2022
List tree data souce to display hierachical data structures in lists-like way. It's UI agnostic, just like view-model and doesn't depend on UI framework

SwiftListTreeDataSource List tree data souce to display hierachical data structures in lists-like way. It's UI agnostic, just like view-model, so can

Dzmitry Antonenka 26 Nov 26, 2022
The Bloc Pattern is a way to separate UI and Logic in SwiftUI codes;

The Bloc Pattern is a way to separate UI and Logic in SwiftUI codes. The Bloc is like a state machine where it accepts an event and produce a state.

mehdi sohrabi 3 Apr 20, 2022
A simple way to hide the notch on the iPhone X

NotchKit NotchKit is a simple way to hide the notch on the iPhone X, and create a card-like interface for your apps. Inspired by this tweet from Sebas

Harshil Shah 1.8k Dec 5, 2022
DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.

DrawerKit What is DrawerKit? DrawerKit is a custom view controller presentation mimicking the kind of behaviour in the Apple Maps app. It lets any vie

Babylon Health 773 Dec 27, 2022
ToastSwiftUI-master - A simple way to show a toast or a popup in SwiftUI

ToastSwiftUI-master - A simple way to show a toast or a popup in SwiftUI

Kushal Shingote 2 May 25, 2022
CITreeView created to implement and maintain that wanted TreeView structures for IOS platforms easy way

CITreeView CITreeView created to implement and maintain that wanted TreeView structures for IOS platforms easy way. CITreeView provides endless treevi

Cenk Işık 126 May 28, 2022
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

SlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageVi

Touchlane 409 Dec 6, 2022
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

SlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageVi

Touchlane 411 Jan 5, 2023
Mimicrate to native UIPageViewController. Each page is new controller, it can be even navigation controller.

Mimicrate to native UIPageViewController. Each page is new controller, it can be even navigation controller. Support parent layout margins, paging and scroll by index. Don't have bug with tranlation when rotate.

Ivan Vorobei 47 Dec 19, 2022
JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box.

JustPersist JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to

Just Eat 167 Mar 13, 2022
Observable is the easiest way to observe values in Swift.

Observable is the easiest way to observe values in Swift. How to Create an Observable and MutableObservable Using MutableObservable you can create and

Robert-Hein Hooijmans 368 Nov 9, 2022
SwiftUIFontIcon The easiest way to implement font icons in your SwiftUI project.

SwiftUIFontIcon The easiest way to implement font icons in your SwiftUI project. Usage The library is super super easy to use, just something like thi

Bui Dac Huy 81 Dec 27, 2022
Easiest way to create an attributed UITextView (with support for multiple links and from html)

AttributedTextView Easiest way to create an attributed UITextView (with support for multiple links and html). See the demo app and the playground for

Edwin Vermeer 430 Nov 24, 2022