Permalink
Browse files

Merge pull request #7 from dchohfi/master

#5 fixing, calling paginatorView:willDisplayView:atIndex: method declared on delegate protocol
  • Loading branch information...
2 parents bfe63d0 + dac45bb commit d29a479427e3a7c7570e706c2fc9133f6111b747 @dorshorst dorshorst committed Sep 14, 2012
Showing with 10 additions and 2 deletions.
  1. +6 −2 Example/Classes/PERootViewController.m
  2. +4 −0 SYPaginator/SYPaginatorView.m
@@ -24,7 +24,7 @@ - (void)viewDidLoad {
#pragma mark - SYPaginatorViewDataSource
- (NSInteger)numberOfPagesForPaginatorView:(SYPaginatorView *)paginatorView {
- return 99999;
+ return 8;
}
- (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtIndex:(NSInteger)pageIndex {
@@ -39,5 +39,9 @@ - (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtInde
return view;
}
-
+-(void)paginatorView:(SYPaginatorView *)paginatorView
+ willDisplayView:(UIView *)view
+ atIndex:(NSInteger)pageIndex{
+ NSLog(@"will display view at index: %i", pageIndex + 1);
+}
@end
@@ -418,6 +418,10 @@ - (void)_setCurrentPageIndex:(NSInteger)targetPage animated:(BOOL)animated scrol
[self _loadPage:targetPage];
[self _loadPagesToPreloadAroundPageAtIndex:targetPage];
+
+ if(_delegate && [_delegate respondsToSelector:@selector(paginatorView:willDisplayView:atIndex:)]){
+ [_delegate paginatorView:self willDisplayView:[self pageForIndex:targetPage] atIndex:targetPage];
+ }
}
if (scroll) {

0 comments on commit d29a479

Please sign in to comment.