您的位置:首页 > 编程语言

对无限图片轮播器的封装,一句话代码设置轮播器的属性

2016-07-14 21:15 309 查看
提供给外界的接口:

BOOL isAutoCycle ---是否需要自动轮播

NSArray imageArray --- 图片数组

NSArray titleArray --- 文本数组

NSInteger timeDelay --- 图片轮播延迟

//代理方法设定的范例

//示例:****- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

//示例:****- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView

#import <UIKit/UIKit.h>

@class WZHCycleView;

@protocol wzhCycleViewDelegate <NSObject>

@required

/**

* 外界给轮播器传递图片数组的代理方法

*

* @return 返回一个图片名数组

*/

- (nonnull NSArray<NSString *> *)imageArrayForWZHCycleView;

@optional

/**

* 外界给轮播器传送label的标题数组代理方法

*

* @return 返回一个label的显示内容的数组

*/

- (nullable NSArray <NSString *> *)titleArrayForWZHCycleView;

@end

@interface WZHCycleView : UIView

@property (weak,nonatomic) id <wzhCycleViewDelegate>
delegate;

@property (assign,nonatomic) CGFloat timeDelay;

@property (assign,nonatomic,getter=isAutoCycle) BOOL autoCycle;

@property (assign,nonatomic,getter=isNetImage) BOOL netImage;

- (nonnull WZHCycleView *)initWithFrame:(CGRect)frame;

+ (nonnull WZHCycleView *)wzhCycleViewWithFrame:(CGRect)frame;

@end

想看具体demo代码:点我
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  app oc 代码