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

32 lines
800 B
Objective-C

//
// KBKeyboardView.h
// CustomKeyboard
//
// 键盘主容器,内部管理按键行布局。
//
#import <UIKit/UIKit.h>
@class KBKeyboardView, KBKey;
typedef NS_ENUM(NSInteger, KBKeyboardLayoutStyle) {
KBKeyboardLayoutStyleLetters = 0,
KBKeyboardLayoutStyleNumbers
};
@protocol KBKeyboardViewDelegate <NSObject>
@optional
/// 键被点击的回调
- (void)keyboardView:(KBKeyboardView *)keyboard didTapKey:(KBKey *)key;
@end
@interface KBKeyboardView : UIView
@property (nonatomic, weak) id<KBKeyboardViewDelegate> delegate;
@property (nonatomic, assign) KBKeyboardLayoutStyle layoutStyle; // 布局样式(字母/数字)
@property (nonatomic, assign, getter=isShiftOn) BOOL shiftOn; // 大小写状态
- (void)reloadKeys; // 当布局样式/大小写变化时调用
@end