Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dac45bb1c8
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (36 sloc) 1.286 kb
//
// PERootViewController.m
// Paginator Example
//
// Created by Sam Soffes on 3/8/12.
// Copyright (c) 2012 Synthetic. All rights reserved.
//
#import "PERootViewController.h"
#import "PEPageView.h"
@implementation PERootViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Paginator";
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.view.backgroundColor = [UIColor blackColor];
self.paginatorView.pageGapWidth = 30.0f;
}
#pragma mark - SYPaginatorViewDataSource
- (NSInteger)numberOfPagesForPaginatorView:(SYPaginatorView *)paginatorView {
return 8;
}
- (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtIndex:(NSInteger)pageIndex {
static NSString *identifier = @"identifier";
PEPageView *view = (PEPageView *)[paginatorView dequeueReusablePageWithIdentifier:identifier];
if (!view) {
view = [[PEPageView alloc] initWithReuseIdentifier:identifier];
}
view.textLabel.text = [NSString stringWithFormat:@"Page %i of %i", pageIndex + 1, paginatorView.numberOfPages];
return view;
}
-(void)paginatorView:(SYPaginatorView *)paginatorView
willDisplayView:(UIView *)view
atIndex:(NSInteger)pageIndex{
NSLog(@"will display view at index: %i", pageIndex + 1);
}
@end
Jump to Line
Something went wrong with that request. Please try again.