• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • 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

NKJPagerViewController is like a PagerTabStrip, which is in Android. It contains an endlessly scrollable UIScrollView.

NKJPagerViewController

Version License Platform Build Status

NKJPagerViewController is a PagerTabStrip, which is in Android. It contains an endlessly scrollable UIScrollView.

This viewController inspired ICViewPager. The biggest of difference is to endlessly swipe page.

Requirements

NKJPagerViewController higher requires Xcode 6, targeting either iOS 7.1 and above, or Mac OS 10.10 OS X Yosemite and above.

Installation

CocoaPods

pod "NKJPagerViewController"

Usage

Implement as subclass of NKJPagerViewController and imprement dataSource and delegate methods in the subclass.

- (void)viewDidLoad
{
    self.dataSource = self;
    self.delegate = self;

    [super viewDidLoad];
}

NKJPagerViewDataSource

Decide number of tabs.

- (NSUInteger)numberOfTabView
{
    return 10;
}

Decide width for each tab.

- (NSInteger)widthOfTabView
{
    return 160;
}

Setting a view design for each tab.

- (UIView *)viewPager:(NKJPagerViewController *)viewPager viewForTabAtIndex:(NSUInteger)index
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 44)];
    label.backgroundColor = [UIColor grayColor];
    label.font = [UIFont systemFontOfSize:12.0];
    label.text = [NSString stringWithFormat:@"Tab #%lu", index * 10];
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor blackColor];

    return label;
}

Setting a view controller for each tab.

- (UIViewController *)viewPager:(NKJPagerViewController *)viewPager contentViewControllerForTabAtIndex:(NSUInteger)index
{
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    ContentViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"ContentViewController"];
    vc.textLabel = [NSString stringWithFormat:@"Content View #%lu", index];
    return vc;
}

NKJPagerViewDelegate

This method is option.

- (void)viewPager:(NKJPagerViewController *)viewPager didSwitchAtIndex:(NSInteger)index withTabs:(NSArray *)tabs
{
    // do something
}

Author

@nakajijapan

License

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

More Repositories

1

PhotoSlider

PhotoSlider is a simple photo slider and can delete slider with swiping.
Swift
247
star
2

Shari

Shari is the alternative to the library of UIPickerView(drum roll) in Swift. You can select a item using UITableView.
Swift
114
star
3

NKJMovieComposer

NKJMovieComposer is very simple movie composer for iOS.
Swift
40
star
4

Ubaguruma

Ubaguruma is a photo select picker like LINE.
Swift
37
star
5

Sengiri

Sengiri is the screen recording utility. It can easily create GIF movie.
Swift
22
star
6

Ajimi

Ajimi means tasting. In Japanese, 味見. Ajimi is the feedback tool, which anyone can easily feedback to project team any time.
Swift
18
star
7

NKJMultiMovieCaptureView

CaptureSessionView to save videos while touching the screen
Swift
14
star
8

VersionUpdater

Notify users when a new version of your app is available and force them to upgrade the application of the version.
Swift
10
star
9

teiten

Teiten is an app that fixed-point observation a lot earnestly yourself by using a PC camera. 定点観測アプリ
Swift
10
star
10

ColorHex

Initializes the UIColor using hexadecimal.
Swift
9
star
11

SwiftSampleApp

Simple Application For Swift
Swift
8
star
12

frustrationme_app

Web Service - Social Wish Management
Ruby
5
star
13

dotfiles

console setting info
Emacs Lisp
4
star
14

jquery-cool-grid

calclate item's height and show items
CoffeeScript
4
star
15

nakajichan

say
Ruby
3
star
16

NKJPhotoSliderController

PhotoSlider can a simple photo slider and delete slider with swiping.
Objective-C
3
star
17

unkore_iphone

iPhone Game - Bureau of Nakajima Cleansing
Objective-C
3
star
18

podspec_bump

A command line tools to bump podspec version for CocoaPods.
Ruby
3
star
19

NoticeGitHubIssue

Ruby
2
star
20

post-feeds-in-irc

Post feeds in IRC
Ruby
2
star
21

SwiftSampleAppForCollectionView

Try to create a simple application using CollectionView (Normal Version and RxSwift Version)
Swift
2
star
22

frustrationme_chrome_extension

Chrome Extension for http://www.frustration.me
JavaScript
1
star
23

frustrationme_chrome_app

Chrome App for http://www.frustration.me
1
star
24

Zend_Framework_Db_Adapter_Pdo

Zend Framework側でSQLログを吐かせる方法
PHP
1
star
25

Zend_Framework_View_Smarty

Zend FrameworkでSmartyを利用する
PHP
1
star