Permalink
Browse files

#5 fixing, calling paginatorView:willDisplayView:atIndex: method decl…

…ared on delegate protocol
  • Loading branch information...
1 parent 912d541 commit dac45bb1c86948f36dc6c2757f19745de2987058 @dchohfi dchohfi committed Aug 22, 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
@@ -410,6 +410,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 dac45bb

Please sign in to comment.