InfoSearchView.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 cancelBlock;
  24. @property (nonatomic, weak) id<InfoSearchViewDelegate> delegate;
  25. @property (nonatomic, strong) TDSearchBar *searchBar;
  26. @property (nonatomic, copy) NSString *searchPlaceholder;
  27. - (instancetype)initWithFrame:(CGRect)frame type:(InfoSearchViewType)type;
  28. - (void)setNowSearchData:(NSString *)searchStr;
  29. - (void)showLineView;
  30. @end
  31. NS_ASSUME_NONNULL_END