2
This commit is contained in:
31
keyBoard/Class/Search/V/KBSearchBarView.h
Normal file
31
keyBoard/Class/Search/V/KBSearchBarView.h
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user