diff --git a/EVNCustomSearchBar/EVNCustomSearchBar.h b/EVNCustomSearchBar/EVNCustomSearchBar.h index d27942a..85de48b 100644 --- a/EVNCustomSearchBar/EVNCustomSearchBar.h +++ b/EVNCustomSearchBar/EVNCustomSearchBar.h @@ -113,6 +113,7 @@ typedef NS_ENUM(NSUInteger, EVNCustomSearchBarIconAlign) @property (nonatomic, strong) UIView *inputView; +- (BOOL)isFirstResponder; - (BOOL)resignFirstResponder; - (BOOL)becomeFirstResponder; diff --git a/EVNCustomSearchBar/EVNCustomSearchBar.m b/EVNCustomSearchBar/EVNCustomSearchBar.m index 7105fda..bc45cf9 100644 --- a/EVNCustomSearchBar/EVNCustomSearchBar.m +++ b/EVNCustomSearchBar/EVNCustomSearchBar.m @@ -270,6 +270,11 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor } } +- (BOOL)isFirstResponder +{ + return [_textField isFirstResponder]; +} + - (BOOL)resignFirstResponder { return [_textField resignFirstResponder];