UIView+ZYLEmptyView.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // UIView+ZYLEmptyView.h
  3. // mask
  4. //
  5. // Created by 翟玉磊 on 2018/12/9.
  6. // Copyright © 2018 翟玉磊. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "ZYLEmptyDataView.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface UIView (ZYLEmptyView)
  12. /// emptyDataView
  13. @property (nonatomic , readwrite , strong) ZYLEmptyDataView *emptyDataView;
  14. /**
  15. 无数据显示友好文本提示视图
  16. @param type 显示类型
  17. @param emptyInfo 无数据时提示文字信息,不传则为默认;前提是 hasData = NO && hasError = NO
  18. @param errorInfo 无数据且请求错误时提示文字信息,不传则为默认;前提是 hasData = NO && hasError = YES
  19. @param offsetTop 显示的图片的中心点Y值距离其父类视图的顶部的距离
  20. @param hasData 是否存在数据
  21. @param hasError 是否存在错误
  22. @param reloadBlock 如果有加载按钮点击的回调
  23. */
  24. - (void)zyl_configEmptyViewWithType:(ZYLEmptyDataViewType)type emptyInfo:(nullable NSString *)emptyInfo errorInfo:(nullable NSString *)errorInfo offsetTop:(CGFloat)offsetTop hasData:(BOOL)hasData hasError:(BOOL)hasError reloadBlock:(nullable void(^)(void))reloadBlock;
  25. - (void)zyl_configEmptyViewWithType:(ZYLEmptyDataViewType)type emptyInfo:(nullable NSString *)emptyInfo errorInfo:(nullable NSString *)errorInfo offsetTop:(CGFloat)offsetTop bgColor:(nullable UIColor *)bgColor hasData:(BOOL)hasData hasError:(BOOL)hasError reloadBlock:(nullable void(^)(void))reloadBlock;
  26. /// 可以设置空界面的Y轴高度
  27. - (void)zyl_configEmptyViewWithType:(ZYLEmptyDataViewType)type emptyInfo:(nullable NSString *)emptyInfo errorInfo:(nullable NSString *)errorInfo offsetTop:(CGFloat)offsetTop emptyDataViewTop:(CGFloat)emptyDataViewTop hasData:(BOOL)hasData hasError:(BOOL)hasError reloadBlock:(nullable void(^)(void))reloadBlock;
  28. @end
  29. NS_ASSUME_NONNULL_END