• This repository has been archived on 30/Sep/2019
  • Stars
    star
    278
  • Rank 148,454 (Top 3 %)
  • Language
    Objective-C
  • License
    Other
  • Created almost 10 years ago
  • Updated over 8 years ago

Reviews

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

Repository Details

DMPagerViewController is page navigation controller like the one used in Twitter or Tinder

DMPagerViewController

[![CI Status](http://img.shields.io/travis/Daniele Margutti/DMPagerViewController.svg?style=flat)](https://travis-ci.org/Daniele Margutti/DMPagerViewController) Version License Platform

DMPagerViewController is a UIViewController subclass which mimics the navigation system used in Twitter and Tinder clients for iOS. It also add some special effects like icon tint color fade on scroll and page parallax effect during scroll. It also offer several configuration options you can easily see in .h file. Because an image worth more than thousand of words this is a short gif which show you the class.

A short introduction

To run the example project, clone the repo, and run pod install from your project.

Then you can create a new DMPagerViewController which contains your child view controllers like this:

UIViewController * vc1 = ...;
UIViewController * vc2 = ...;
UIViewController * vc3 = ...;
self.pagerController = [[DMPagerViewController alloc] initWithViewControllers: @[vc1,vc2,vc3]];

Your child view controllers must be conform to DMPagerViewControllerProtocol protocol in order to return the appropriate item to show into the navigation bar (used only when .useNavigationBar is set to YES).

So each view controller must implement:

- (DMPagerNavigationBarItem *)pagerItem {
	 DMPagerNavigationBarItem *item;
	 UIImage *itemIcon = ...;
	 NSAttributedString *itemTitle = ...;
	 item = [DMPagerNavigationBarItem newItemWithText:itemTitle andIcon: itemIcon];
	item.renderingMode = DMPagerNavigationBarItemModeOnlyText;
	return item;
}

Using .renderingMode you can decide what show for a specified item (the icon, icon and text or only the text).

You can choose between three different transitions to use when moving programmatically between pages using -setPageIndex:animated::

typedef NS_ENUM(NSInteger, DMPagerViewControllerAnimation) {
	// Standard UIScrollView animation
	DMPagerViewControllerAnimationStandard,
	// Ease In+Out animation on scroll
	DMPagerViewControllerAnimationEaseInOut,
	// Animation with final bounce
	DMPagerViewControllerAnimationBounceEnd,
	// Animation with initial+final bounce
	DMPagerViewControllerAnimationBounceStartEnd
};

Navigation Bar can also be customized (it's an UIView): you can decide what kind of transition (in term of colors) you want to use for navigation bar items: take a look at .colorizeMode (DMPagerNavigationBarItemColorize). Also you can decide the layout of the navigation bar itself via .style property (DMPagerNavigationBarStyle)

You can push it from a navigation stack or put it into the root window. You can also access to navigationBar configuration via .navigationBar property.

Requirements

It works fine with iOS 8. Should work in iOS7 but I've not tested it.

Installation

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

pod "DMPagerViewController"

Author

Daniele Margutti Mail: [email protected] Web: danielemargutti.com

License

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

More Repositories

1

SwiftDate

๐Ÿ” Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.
Swift
7,603
star
2

SwiftLocation

โš“๏ธ Async/Await CLLocationManager Wrapper for Apple Platforms
Swift
3,386
star
3

SwiftRichString

๐Ÿ‘ฉโ€๐ŸŽจ Elegant Attributed String composition in Swift sauce
Swift
3,097
star
4

Hydra

โšก๏ธ Lightweight full-featured Promises, Async & Await Library in Swift
Swift
1,973
star
5

Repeat

๐Ÿ•ฆ Modern Timer in Swift, Debouncer and Throttler (alternative to NSTimer) made with GCD
Swift
1,466
star
6

UIWindowTransitions

๐Ÿƒโ€โ™‚๏ธ Animated transitions for UIWindow's rootViewController property
Swift
472
star
7

ImageSizeFetcher

Finds the type/size of an image given its URL by fetching as little data as needed
Swift
440
star
8

ScrollStackController

๐Ÿงฉ Easy scrollable layouts in UIKit - an UIStackView which scroll and uses root views of child view controllers.
Swift
435
star
9

Owl

A declarative type-safe framework for building fast and flexible lists with UITableViews & UICollectionViews
Swift
432
star
10

Flow

Declarative approach to populate and manage UITableViews (see https://github.com/malcommac/FlowKit)
Swift
423
star
11

SwiftSimplify

๐Ÿฅท High-performance polyline simplification library - port of simplify.js
Swift
299
star
12

DMLazyScrollView

Lazy Loading UIScrollView for iOS (with support for infinite scrolling)
Objective-C
293
star
13

FlowKit

A declarative type-safe framework for building fast and flexible list with Tables & Collection
Swift
211
star
14

DMCircularScrollView

Infinite/Circular Scrolling Implementation for UIScrollView
Objective-C
205
star
15

ScrollingStackContainer

Efficient Scrolling UIStackView in Swift - DEPRECATED (use ScrollStackController)
Swift
198
star
16

SwiftScanner

String Scanner in pure Swift (supports unicode)
Swift
171
star
17

SwiftMsgPack

๐Ÿ’ฌ Fast & Lightweight MsgPack Serializer & Deserializer for Swift
Swift
154
star
18

DMSlidingCell

Swipe To Reveal UITableViewCell Implementation as like in Twitter
Objective-C
152
star
19

DMSplitView

New NSSplitView class with multiple subviews resize behaviors and animated transitions
Objective-C
116
star
20

DMScrollingTicker

Advanced horizontal scrolling ticker for iOS
Objective-C
110
star
21

DMDynamicWaterfall

UICollectionView Waterfall Layout with UIKit Dynamics
Objective-C
109
star
22

DMTabBar

XCode 4.x like inspector segmented control
Objective-C
108
star
23

HermesNetwork

Swift
72
star
24

DMInspectorPalette

Animated NSScrollView with collapsible sections like in XCode Inspector
Objective-C
61
star
25

SwiftUnistroke

โœ๏ธ $1 Unistroke Gesture Recognizer in Swift
Swift
53
star
26

UAParserSwift

๐Ÿ—บ User-Agent Parser based upon ua-parser.js
Swift
40
star
27

DMPageControl

An high customizable alternative to UIPageControl
39
star
28

DMTwitterOAuth

Twitter OAuth Library (Callback URL Login)
Objective-C
37
star
29

DMScrollViewStack

DMScrollViewStack is a UIScrollView subclass that efficiently handles a vertical stack of multiple scrollviews
Objective-C
33
star
30

DMLocationManager

Location Manager for iOS made simple
Objective-C
27
star
31

DMPathBar

XCode's Yosemite like path bar of OS X
Objective-C
25
star
32

Swift-Coding-Guidelines

A repository to collect best practices when programming with Swift
21
star
33

xcbetarunner

Run & Debug projects [easily] with stable Xcode on beta iOSย devices
Swift
17
star
34

GitLabSwift

๐Ÿ›ต Async/Await GitLab REST APIs v4 for Swift
Swift
17
star
35

DMCacheBox

Fast advanced caching system for Objective-C (Cocoa/iOS compatible)
Objective-C
14
star
36

RealEventsBus

๐ŸšŽ Simple type-safe event bus implementation in swift
Swift
13
star
37

DMMultiDelegatesProxy

Multiple delegate architecture made using NSProxy
Objective-C
10
star
38

Glider-Old

โœˆ๏ธ Fast & powerful logger for Swift
Swift
9
star
39

NSSplitView-Animatable

NSSplitView Category to perform simple animations with dividers
Objective-C
9
star
40

SlidingSheet

Configurable Bottom Sheet for UIKit - like AirBnb and Apple Maps
Swift
8
star
41

CircularScroller

Efficient and Lightweight endless UIScrollView implementation in Swift
Swift
7
star
42

DMAPNServer

APN - Apple Push Notification Server in PHP
PHP
6
star
43

DMCoreDataUtils

Utilities methods for Apple's Core Data Storage
Objective-C
6
star
44

sentry-cocoa-sdk-xcframeworks

A mirror for https://github.com/getsentry/sentry-cocoa to add support for binary (xcframework) distribution with swift package manager.
Shell
4
star
45

CAKeyFrameAnimation-Evaluators

Easily specify CAKeyFrameAnimation curves using C functions or ObjC Class
Objective-C
3
star
46

ZoomableListController

Apple's iOS Weather App List Imitation written in Swift
Swift
2
star
47

MeetingBot

Your next call on Mac status bar
Swift
2
star
48

Konsole

In-app Swift tools for great iOS developers
1
star
49

DMGrid

A simple 2D Grid class made in Objective-C
Objective-C
1
star
50

Envy

Type safe environment variables from shell processes and .env files
1
star