BBAPanelItem.h
1.89 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
//
// BBAPanelItem.h
// BBAUIKit
//
// Created by Guo,Zhaozhuo on 2020/3/16.
// Copyright © 2020 Baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BBAPanelCommon.h"
/*!
@brief 点击action事件回调
*/
typedef void (^BBAPanelActionHandler) (void);
@interface BBAPanelItem : NSObject
/// 唯一标示,只读,业务方可用来更新对应item
@property (nonatomic, readonly) NSString *identifier;
/// 名字
@property (nonatomic, strong) NSString *displayName;
/// 文字颜色,如需要适配darkmode,请使用 textColor
@property (nonatomic, copy) NSString *textColorHex;
/// 文字颜色
@property (nonatomic, strong) UIColor *textColor;
/// 显示图片,与iconURL属性同时设置时,会作为iconURL加载的占位图
@property (nonatomic, strong) UIImage *icon;
/// 图片URL,资源加载的占位图为icon属性,icon属性为nil,则无占位图
@property (nonatomic, strong) NSURL *iconURL;
/// 红点飘新
@property (nonatomic, assign) BOOL hasBadge;
/// 数字/文字飘新
@property (nonatomic, copy) NSString *badgeValue;
/// 12.1新增,面板内cell飘数字的精度类型
@property (nonatomic, assign) BBAPanelBadgeValuePrecisionType badgeValuePrecisionType;
/// 点击事件block
@property (nonatomic, copy) BBAPanelActionHandler actionHandler;
/// 是否禁止点击,默认不禁止YES
@property (nonatomic, assign) BOOL enabled;
/// 点击后是否面板消失,默认消失YES
@property (nonatomic, assign) BOOL dismissPanel;
/*!
@method
@brief 初始化函数,返回一个action 实例对象
@param displayName 默认名字
@param icon 图片
@param handler 点击事件回调block
*/
- (instancetype)initWithDisplayName:(NSString *)displayName
icon:(UIImage *)icon
actionHandler:(BBAPanelActionHandler)handler;
@end