• Stars
    star
    408
  • Rank 102,083 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Infinite paging controller, scrolling through contents and title bar scrolls with a delay

PageController

Build-Status CocoaPods Carthage compatible license

PageController is infinite paging controller, scrolling through contents and title bar scrolls with a delay. Then it provide user interaction to smoothly and effortlessly moving. It is for iOS written in Swift.

sample

Requirements

PageController Xcode Swift
0.7.x + 9.4 4.1
0.6.x 9.2 4.0
0.5.x 8.2 3.0
0.4.x 8.0 2.2
0.3.x 7.0+ 2.0
0.2.0 6.4 1.2

Features

  • To inherit from DCScrollView
  • Use UIViewController, not UIView like UITabBarController
  • Support AutoLayout about MenuCell
  • Handling to change current view controller with Delegate.
  • Scrolling smoothly and effortlessly
  • Keep to smoothly in scrolling contents

Installation

CocoaPods

pod 'PageController'

Carthage

To integrate PageController into your Xcode project using Carthage, specify it in your Cartfile:

github "hirohisa/PageController" ~> 0.7.1

Usage

viewControllers

Type is [UIViewController], and element must have title.

import PageController

class CustomViewController: PageController {

    override func viewDidLoad() {
        super.viewDidLoad()

        viewControllers = createViewControllers()
    }

    func createViewControllers() -> [UIViewController] {
        let names = [
            "favorites",
            "recents",
            "contacts",
            "history",
            "more",
        ]

        return names.map { name -> UIViewController in
            let viewController = ContentViewController()
            viewController.title = name
            return viewController
        }
    }
}

MenuBar

Enable to change backgroundColor, frame. If you change MenuBarCell.height, then override frameForMenuBar and set height.

/// backgroudColor
menuBar.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.9)
/// skip to auto-select after scrolling
menuBar.isAutoSelectDidEndUserInteractionEnabled = false

/// frame, override this function
override var frameForMenuBar: CGRect {
    let frame = super.frameForMenuBar

    return CGRect(x: frame.minX, y: frame.minY, width: frame.width, height: 60)
}

MenuBarCell

Enable to use Custom Cell supported MenuBarCellable protocol:

public protocol MenuBarCellable {
    var index: Int { get set }
    func setTitle(_ title: String)
    func setHighlighted(_ highlighted: Bool)
    func prepareForReuse()
}

public func register(_ cellClass: MenuBarCellable) {
    guard let cellClass = cellClass as? UIView.Type else { fatalError() }
    self.cellClass = cellClass
}

public func register(_ nib: UINib) {
    self.nib = nib
}

MenuBarCellable

public protocol MenuBarCellable {

    // it's used by PageController
    var index: Int { get set }

    // it is used to set to Label.text, caused by deprecating MenuCell over 0.7
    func setTitle(_ title: String)

    // it's instead of `updateData` over 0.7,
    func setHighlighted(_ highlighted: Bool)

    // Called by the menu bar on creating the instance.
    func prepareForUse()

}

License

PageController is available under the MIT license.

More Repositories

1

ImageLoaderSwift

A lightweight and fast image loader for iOS written in Swift.
Swift
292
star
2

RefreshSlide

Reload with slide animation before/after refreshing for iOS written in Swift.
Swift
58
star
3

Font-Awesome

Use Font Awesome in project written in Swift.
Swift
40
star
4

BrickView

BrickView is a simple dynamic grid layout view like Pinterest or Esty.
Objective-C
39
star
5

Union

Context transitioning's animation manager for iOS written in Swift.
Swift
36
star
6

Jukeboks

Jukeboks is a fast viewer / player app
JavaScript
24
star
7

DCScrollView

DCScrollView is an extension of UIScrollView that scrolling through the content, the title scrolls with a delay.
Objective-C
21
star
8

Shelf

Shelf is a simple dynamic layout like AppStore for iOS written in Swift.
Swift
12
star
9

ImageLoader

A lightweight and fast image loader for iOS.
Objective-C
9
star
10

Diskcached

Diskcached is simple disk cache for iOS.
Objective-C
8
star
11

FKTabBarController

FKTabBarController is intended to change the tabbar and items instead of UITabBarController
Objective-C
8
star
12

VCRouter

VCRouter is UINavigationController's manager.
Objective-C
6
star
13

ios.samples

Sample projects for iOS
Swift
4
star
14

atom-project-runner

Run project's code in Atom.
JavaScript
4
star
15

SLBundle

SLBundle provides to specify a standard language for iOS
Objective-C
3
star
16

i18n-cocoa

Manage translation and localization with analysis, for iOS, OSX.
Ruby
3
star
17

file_crawler

FileCralwer can search, collect, organize files
Ruby
3
star
18

Floating

Floating is a very flexible overlay library.
Swift
2
star
19

SerializedDataStorage

SerializedDataStorage is a simple caching class, using NSKeyedArchiver.
Objective-C
2
star
20

heroku-rails-starterkit

sample project heroku + rails
Ruby
2
star
21

PullToRefresh

A simple CollectionViewController with UIRefreshControl
Swift
2
star
22

heroku-sinatra-starterkit

Application starterkit with sinatra for heroku
CSS
2
star
23

iBeacon

iBeaconTest
Objective-C
1
star
24

HHURLRoute

Objective-C
1
star
25

PhotosSample

Sample Project for Photos Framework (iOS8)
Objective-C
1
star
26

playground

Swift
1
star
27

AnimationKit

AnimationKit is a lightweight and easy animation framework.
Swift
1
star
28

Regular

Utility custom class and extensions.
Swift
1
star
29

Utilities

Objective-C
1
star