From 478257c2a45336ece43cb487f37718bf60893fa3 Mon Sep 17 00:00:00 2001 From: zonghongyan Date: Mon, 23 Oct 2017 13:48:32 +0800 Subject: [PATCH] add isFirstResponder --- EVNCustomSearchBar/EVNCustomSearchBar.h | 1 + EVNCustomSearchBar/EVNCustomSearchBar.m | 5 +++++ 2 files changed, 6 insertions(+) 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];