Latest 0.1.1
Homepage https://github.com/AdamsDevelopment/Paginator
License MIT
Platforms ios 9.0
Authors

Paginator

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

===============================================================================

The controllers implemented in the pagingViewController do need to conform to the Pageable protocol.

class ViewControllerOne: UIViewController, Pageable {

    // MARK: - Paging implicit properties

    var pageTitle: String {
        return "vcOne"
    }

    func pagingViewDidShow() {
        textfield.becomeFirstResponder()
    }
}

To implement this in your base viewController:

    /// This function is used to only at the pagingView (top bar),
    /// with an amount of titles given to it.
    func exampleAddingOnlyThePagingView() {
        // PagingView titles
        let pagingView = PagingView(titles: ["Red", "Gray", "Blue"])

        // PagingView Delegate
        pagingView.delegate = self

        // Add pagingView
        pagingView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(pagingView)

        // give the pagingView some contstraints
        pagingView.topAnchor.constraint(equalTo: view.topAnchor, constant: 16).isActive = true
        pagingView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
        pagingView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
        pagingView.heightAnchor.constraint(equalToConstant: 100).isActive = true
    }

    /// Here we instantiate some viewControllers, and show the pagingViewController with the initialized viewControllers.
    /// We can add this PagingViewController to a containerView so we have a baseController that is in control of the pagingViewController.
    func exampleAddingThePagingViewController() {
        let controller1 = ViewControllerOne()
        let controller2 = ViewControllerTwo()
        let controller3 = ViewControllerThree()

        let controller = PagingViewController(viewControllers: [controller1, controller2, controller3], initialIndex: 0)
        self.present(controller, animated: true, completion: nil)
    }

Installation

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

pod 'ADPaginator'

Contributing

For those who want to contribute, please create feature branches on develop and create a Pull Request when done. We will work with a release ‘master’ and beta ‘beta’ branch.

Author

AdamsDevelopment, [email protected]

License

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

Latest podspec

{
    "name": "ADPaginator",
    "version": "0.1.1",
    "summary": "Paginator - paging view",
    "swift_version": "4.0",
    "description": "This is a top bar like android to paginate between viewControllers.",
    "homepage": "https://github.com/AdamsDevelopment/Paginator",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "AdamsDevelopment": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AdamsDevelopment/Paginator.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Paginator/Classes/**/*"
}

Pin It on Pinterest

Share This