| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // XLCycleScrollView.h
- // CycleScrollViewDemo
- //
- // Created by xie liang on 9/14/12.
- // Copyright (c) 2012 xie liang. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import "StyledPageControl.h"
- @protocol XLCycleScrollViewDelegate;
- @protocol XLCycleScrollViewDatasource;
- @interface XLCycleScrollView : UIView<UIScrollViewDelegate>
- {
- UIScrollView *_scrollView;
- StyledPageControl *_pageControl;
-
- id<XLCycleScrollViewDelegate> __unsafe_unretained _delegate;
- id<XLCycleScrollViewDatasource> __unsafe_unretained _datasource;
-
- NSInteger _totalPages;
- NSInteger _curPage;
-
- NSMutableArray *_curViews;
- }
- - (id)initWithFrame:(CGRect)frame pcRect:(CGRect)pcRect;
- @property (nonatomic,readonly) UIScrollView *scrollView;
- @property (nonatomic,readonly) StyledPageControl *pageControl;
- @property (nonatomic,assign) NSInteger currentPage;
- @property (nonatomic,assign,setter = setDataource:) id<XLCycleScrollViewDatasource> datasource;
- @property (nonatomic,assign,setter = setDelegate:) id<XLCycleScrollViewDelegate> delegate;
- - (void)reloadData;
- - (void)setViewContent:(UIView *)view atIndex:(NSInteger)index;
- @end
- @protocol XLCycleScrollViewDelegate <NSObject>
- @optional
- - (void)didClickPage:(XLCycleScrollView *)csView atIndex:(NSInteger)index;
- @end
- @protocol XLCycleScrollViewDatasource <NSObject>
- @required
- - (NSInteger)numberOfPages;
- - (UIView *)pageAtIndex:(NSInteger)index;
- @end
|