Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…ared on delegate protocol
  • Loading branch information...
commit dac45bb1c86948f36dc6c2757f19745de2987058 1 parent 912d541
Diego Chohfi dchohfi authored
8 Example/Classes/PERootViewController.m
@@ -24,7 +24,7 @@ - (void)viewDidLoad {
24 24 #pragma mark - SYPaginatorViewDataSource
25 25
26 26 - (NSInteger)numberOfPagesForPaginatorView:(SYPaginatorView *)paginatorView {
27   - return 99999;
  27 + return 8;
28 28 }
29 29
30 30 - (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtIndex:(NSInteger)pageIndex {
@@ -39,5 +39,9 @@ - (SYPageView *)paginatorView:(SYPaginatorView *)paginatorView viewForPageAtInde
39 39
40 40 return view;
41 41 }
42   -
  42 +-(void)paginatorView:(SYPaginatorView *)paginatorView
  43 + willDisplayView:(UIView *)view
  44 + atIndex:(NSInteger)pageIndex{
  45 + NSLog(@"will display view at index: %i", pageIndex + 1);
  46 +}
43 47 @end
4 SYPaginator/SYPaginatorView.m
@@ -410,6 +410,10 @@ - (void)_setCurrentPageIndex:(NSInteger)targetPage animated:(BOOL)animated scrol
410 410
411 411 [self _loadPage:targetPage];
412 412 [self _loadPagesToPreloadAroundPageAtIndex:targetPage];
  413 +
  414 + if(_delegate && [_delegate respondsToSelector:@selector(paginatorView:willDisplayView:atIndex:)]){
  415 + [_delegate paginatorView:self willDisplayView:[self pageForIndex:targetPage] atIndex:targetPage];
  416 + }
413 417 }
414 418
415 419 if (scroll) {

0 comments on commit dac45bb

Please sign in to comment.
Something went wrong with that request. Please try again.