Bez popisu

DPBannerView.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // DPBannerView.h
  3. // DacaiProject
  4. //
  5. // Created by WUFAN on 14-8-29.
  6. // Copyright (c) 2014年 dacai. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol DPBannerScrollViewDelegate <UIScrollViewDelegate>
  10. @optional
  11. - (void)scrollViewDidBeginTracking:(UIScrollView *)scrollView;
  12. - (void)scrollViewDidEndTracking:(UIScrollView *)scrollView;
  13. @end
  14. @interface DPBannerScrollView : UIScrollView {
  15. @private
  16. struct {
  17. unsigned scrollViewDidBeginTracking : 1;
  18. unsigned scrollViewDidEndTracking : 1;
  19. } _bannerDelegateHas;
  20. }
  21. @end
  22. @protocol DPBannerViewDelegate;
  23. @interface DPBannerView : UIView
  24. @property (nonatomic, strong, readonly) DPBannerScrollView *scrollView;
  25. @property (nonatomic, weak) id<DPBannerViewDelegate> delegate;
  26. @property (nonatomic, strong) NSArray *imageUrls;
  27. @property (nonatomic, assign) CGFloat duration; // 轮播间隔, 默认为5.0f
  28. @property (nonatomic, assign) NSInteger index;
  29. @property (nonatomic, assign) UIViewContentMode defalutContentModel;
  30. - (void)startAutoSwitch;
  31. - (void)stopAutoSwitch;
  32. @end
  33. @protocol DPBannerViewDelegate <NSObject>
  34. @optional
  35. - (void)bannerView:(DPBannerView *)bannerView didSelectedAtIndex:(NSInteger)index;
  36. - (void)bannerView:(DPBannerView *)bannerView didShowAtIndex:(NSInteger)index;
  37. @end