InfoSearchView.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // InfoSearchView.h
  3. // TheoryNetwork
  4. //
  5. // Created by tederen on 2019/9/20.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef enum : NSUInteger {
  11. InfoSearchViewTypeDefault,
  12. InfoSearchViewTypeCancel,
  13. } InfoSearchViewType;
  14. typedef void(^TouchBlock)(void);
  15. @protocol InfoSearchViewDelegate <NSObject>
  16. - (void)searchButtonAction:(UISearchBar *)searchBar;
  17. @optional
  18. //- (void)searchClearXButtonAction:(UISearchBar *)searchBar;
  19. - (void)textDidChange:(NSString *)text;
  20. @end
  21. @interface InfoSearchView : UIView
  22. @property (nonatomic, copy) TouchBlock backBlock;
  23. @property (nonatomic, copy) TouchBlock menuBlock;
  24. @property (nonatomic, copy) TouchBlock cancelBlock;
  25. @property (nonatomic, weak) id<InfoSearchViewDelegate> delegate;
  26. @property (nonatomic, strong) TDSearchBar *searchBar;
  27. @property (nonatomic, copy) NSString *searchPlaceholder;
  28. - (instancetype)initWithFrame:(CGRect)frame type:(InfoSearchViewType)type;
  29. - (void)setNowSearchData:(NSString *)searchStr;
  30. - (void)showLineView;
  31. - (void)setBarPlaceholder:(NSString *)searchPlaceholder;
  32. @end
  33. NS_ASSUME_NONNULL_END