Files
keyboard/CustomKeyboard/View/KBFunctionBarView.h
2025-10-28 15:18:12 +08:00

40 lines
1.2 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KBFunctionBarView.h
// CustomKeyboard
//
// Created by Mac on 2025/10/28.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 功能区顶部的Bar左侧4个按钮右侧3个按钮
@class KBFunctionBarView;
@protocol KBFunctionBarViewDelegate <NSObject>
@optional
/// 左侧 4 个按钮点击index: 0~3
- (void)functionBarView:(KBFunctionBarView *)bar didTapLeftAtIndex:(NSInteger)index;
/// 右侧 3 个按钮点击index: 0~2
- (void)functionBarView:(KBFunctionBarView *)bar didTapRightAtIndex:(NSInteger)index;
@end
@interface KBFunctionBarView : UIView
@property (nonatomic, weak, nullable) id<KBFunctionBarViewDelegate> delegate;
/// 左侧4个按钮懒加载创建等宽水平排布
@property (nonatomic, strong, readonly) NSArray<UIButton *> *leftButtons;
/// 右侧3个按钮懒加载创建等宽水平排布靠右
@property (nonatomic, strong, readonly) NSArray<UIButton *> *rightButtons;
/// 配置按钮标题(可选)
@property (nonatomic, copy) NSArray<NSString *> *leftTitles; // 默认 @[@"帮回", @"会说", @"话术", @"更多"]
@property (nonatomic, copy) NSArray<NSString *> *rightTitles; // 默认 @[@"❤", @"收藏", @"宫格"]
@end
NS_ASSUME_NONNULL_END