This commit is contained in:
2025-11-07 22:22:41 +08:00
parent b23c9a678b
commit 9a39c29e88
12 changed files with 731 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
//
// KBSearchBarView.h
// keyBoard
//
// 顶部搜索栏,独立封装的 View。
// - 左侧圆角输入框,右侧搜索按钮
// - 通过 block 将搜索事件回传给 VC
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBSearchBarView : UIView
/// 输入框
@property (nonatomic, strong, readonly) UITextField *textField;
/// 点击键盘 return 或右侧按钮时回调
@property (nonatomic, copy) void(^onSearch)(NSString *keyword);
/// 占位文字默认“Themes”
@property (nonatomic, copy) NSString *placeholder;
/// 外部可设置关键字
- (void)updateKeyword:(NSString *)keyword;
@end
NS_ASSUME_NONNULL_END