Files
keyboard/keyBoard/Class/Search/V/KBSearchBarView.h
2025-11-17 15:06:05 +08:00

34 lines
775 B
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.

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