You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.5 KiB
82 lines
2.5 KiB
4 years ago
|
//
|
||
|
// TFEmptyBaseView.h
|
||
|
// WXReader
|
||
|
//
|
||
|
// Created by 谢腾飞 on 2020/11/20.
|
||
|
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <UIKit/UIKit.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
typedef void (^TFActionTapBlock)(void);
|
||
|
|
||
|
@interface TFEmptyBaseView : UIView
|
||
|
/** 内容物背景视图 */
|
||
|
@property (nonatomic ,strong ,readonly) UIView *contentView;
|
||
|
|
||
|
@property (nonatomic ,copy) NSString *image;
|
||
|
@property (nonatomic ,copy) NSString *title;
|
||
|
@property (nonatomic ,copy) NSString *detail;
|
||
|
@property (nonatomic ,copy) NSString *btnTitle;
|
||
|
|
||
|
@property (nonatomic ,weak ,readonly) id actionBtnTarget;
|
||
|
@property (nonatomic ,assign ,readonly) SEL actionBtnAction;
|
||
|
|
||
|
@property (nonatomic ,copy) TFActionTapBlock tapContentViewBlock;
|
||
|
@property (nonatomic ,copy ,readonly) TFActionTapBlock btnClickBlock;
|
||
|
|
||
|
@property (nonatomic ,strong ,readonly) UIView *customView;
|
||
|
|
||
|
/** 是否隐藏 EmptyView 默认隐藏 */
|
||
|
@property (nonatomic ,assign) BOOL autoShowEmptyView;
|
||
|
|
||
|
// 初始化配置
|
||
|
- (void)prepare;
|
||
|
|
||
|
// 重置Subviews
|
||
|
- (void)setupSubviews;
|
||
|
|
||
|
/***
|
||
|
* 构造方法 - 创建 EmptyView
|
||
|
* @param image 占位图片名称
|
||
|
* @param title 标题
|
||
|
* @param detail 详细描述
|
||
|
* @param btnTitle 按钮的名称
|
||
|
* @param target 响应的对象
|
||
|
* @param action 按钮点击事件
|
||
|
* @return 返回一个 EmptyView
|
||
|
*/
|
||
|
+ (instancetype)emptyActionViewWithImage:(NSString *)image title:(NSString *)title detail:(NSString *)detail btnTitle:(NSString *)btnTitle target:(id)target action:(SEL)action;
|
||
|
|
||
|
/***
|
||
|
* 构造方法2 - 创建 EmptyView
|
||
|
* @param image 占位图片名称
|
||
|
* @param title 占位描述
|
||
|
* @param detail 详细描述
|
||
|
* @param btnTitle 按钮的名称
|
||
|
* @param btnClickBlock 按钮点击事件回调
|
||
|
* @return 返回一个 EmptyView
|
||
|
*/
|
||
|
+ (instancetype)emptyActionViewWithImage:(NSString *)image title:(NSString *)title detail:(NSString *)detail btnTitle:(NSString *)btnTitle btnClickBlock:(TFActionTapBlock)btnClickBlock;
|
||
|
|
||
|
/***
|
||
|
* 构造方法3 - 创建 EmptyView
|
||
|
* @param image 占位图片名称
|
||
|
* @param title 占位描述
|
||
|
* @param detail 详细描述
|
||
|
* @return 返回一个没有点击事件的 EmptyView
|
||
|
*/
|
||
|
+ (instancetype)emptyViewWithImage:(NSString *)image title:(NSString *)title detail:(NSString *)detail;
|
||
|
|
||
|
/***
|
||
|
* 构造方法4 - 创建一个自定义的 EmptyView
|
||
|
* @param customView 自定义view
|
||
|
* @return 返回一个自定义内容的 EmptyView
|
||
|
*/
|
||
|
+ (instancetype)emptyViewWithCustomView:(UIView *)customView;
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|