NIMPageView.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // NIMPageView.h
  3. // NIMKit
  4. //
  5. // Created by chris.
  6. // Copyright (c) 2015年 NetEase. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class NIMPageView;
  10. @protocol NIMPageViewDataSource <NSObject>
  11. - (NSInteger)numberOfPages: (NIMPageView *)pageView;
  12. - (UIView *)pageView: (NIMPageView *)pageView viewInPage: (NSInteger)index;
  13. @end
  14. @protocol NIMPageViewDelegate <NSObject>
  15. @optional
  16. - (void)pageViewScrollEnd: (NIMPageView *)pageView
  17. currentIndex: (NSInteger)index
  18. totolPages: (NSInteger)pages;
  19. - (void)pageViewDidScroll: (NIMPageView *)pageView;
  20. - (BOOL)needScrollAnimation;
  21. @end
  22. @interface NIMPageView : UIView<UIScrollViewDelegate>
  23. @property (nonatomic,strong) UIScrollView *scrollView;
  24. @property (nonatomic,weak) id<NIMPageViewDataSource> dataSource;
  25. @property (nonatomic,weak) id<NIMPageViewDelegate> pageViewDelegate;
  26. - (void)scrollToPage: (NSInteger)pages;
  27. - (void)reloadData;
  28. - (UIView *)viewAtIndex: (NSInteger)index;
  29. - (NSInteger)currentPage;
  30. //旋转相关方法,这两个方法必须配对调用,否则会有问题
  31. - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  32. duration:(NSTimeInterval)duration;
  33. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  34. duration:(NSTimeInterval)duration;
  35. @end