BBALoadIndicatorView.h
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// BBALoadIndicatorView.h
// BBAUIKit
//
// Created by zhangyunchao on 2020/8/8.
// Copyright © 2020 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, BBALoadIndicatorType) {
BBALoadIndicatorTypeDefault, // 默认,不阻塞用户操作
BBALoadIndicatorTypeModal, // modal,阻塞用户操作当前页面
};
@interface BBALoadIndicatorView : UIView
/// 加载指示,默认不带按钮,不阻塞交互
+ (void)showLoading:(NSString *)message;
/// 加载指示,不带关闭按钮,交互类型可配置
/// @param message 文本
/// @param type 交互类型,区分是否阻塞用户操作
+ (void)showLoading:(NSString *)message
loadingType:(BBALoadIndicatorType)type;
/// 加载指示,按钮及交互类型可配置
/// @param message 提示文案
/// @param type 交互类型
/// @param callback 关闭按钮点击回调,callback传入为nil则不展示关闭按钮,否则展示
+ (void)showLoading:(NSString *)message
loadingType:(BBALoadIndicatorType)type
callback:(nullable dispatch_block_t)callback;
/// 加载指示,按钮及交互类型可配置,父view可配置
/// @param message 提示文案
/// @param type 交互类型
/// @param hostView 指定加载父View
/// @param callback 关闭按钮点击回调,callback传入为nil则不展示关闭按钮,否则展示
+ (void)showLoading:(NSString *)message
loadingType:(BBALoadIndicatorType)type
hostView:(nullable UIView *)hostView
callback:(nullable dispatch_block_t)callback;
/// 在指定 darkmode模式下执行
/// @param mode darkmode标识,设置为nil则无效,内部按照当前mode适配
/// @param taskBlock toast任务block
+ (void)runInMode:(nullable NSString *)mode
withTask:(dispatch_block_t)taskBlock;
/// 判定当前加载指示是否正在展示中
+ (BOOL)isIndicatorOnShowing;
/// 隐藏加载
+ (void)hideLoadIndicator;
@end
NS_ASSUME_NONNULL_END