#import "UIView+LZEmptyView.h" @implementation UIView (LZEmptyView) - (void)lz_showEmptyViewWithImage:(UIImage *)image content:(NSString *)content{ self.ly_emptyView = [LZEmptyView emptyViewWithImage:image titleStr:nil detailStr:content]; [self ly_showEmptyView]; } - (void)lz_showEmptyViewWithImage:(UIImage *)image content:(NSString *)content btnTitle:(nonnull NSString *)btnTitle btnColor:(nonnull UIColor *)btnColor block:(nonnull void (^)(void))block{ self.ly_emptyView = [LZEmptyView emptyActionViewWithImage:image titleStr:nil detailStr:content btnTitleStr:btnTitle btnClickBlock:block]; self.ly_emptyView.actionBtnFont = LCFont14; self.ly_emptyView.actionBtnTitleColor = btnColor; [self ly_showEmptyView]; } - (void)lz_showEmptyViewWithUrl:(NSURL *)url content:(NSString *)content{ [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:url options:SDWebImageDownloaderUseNSURLCache progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { self.ly_emptyView = [LZEmptyView emptyViewWithImage:image titleStr:nil detailStr:content]; [self ly_showEmptyView]; }]; } - (void)lz_showEmptyViewWithImageSizeWUWU:(UIImage *)image content:(NSString *)content{ self.ly_emptyView = [LZEmptyView emptyViewWithImage:image titleStr:nil detailStr:content]; self.ly_emptyView.imageSize = CGSizeMake(55, 55); [self ly_showEmptyView]; } - (void)lz_showEmptyViewWithImage:(UIImage *)image title:(NSString *)title content:(NSString *)content btnTitle:(NSString *)btnTitle styleBlock:(void (^)(LYEmptyView *emptyView))styleBlock block:(nonnull void (^)(void))block{ self.ly_emptyView = [LZEmptyView emptyActionViewWithImage:image titleStr:title detailStr:content btnTitleStr:btnTitle btnClickBlock:block]; if (styleBlock != nil) { styleBlock(self.ly_emptyView); } [self ly_showEmptyView]; } //- (void)lz_showAfreshLoadViewWithMsg:(NSString *)msg afreshLoadAction:(nonnull void (^)(void))block{ // self.ly_emptyView = [LZEmptyView emptyActionViewWithImage:[UIImage imageNamed:@"base_no_network"] titleStr:msg detailStr:nil btnTitleStr:@"点击重新加载" btnClickBlock:block]; // [self ly_showEmptyView]; //} - (void)lz_hideEmptyView{ [self ly_hideEmptyView]; } @end