Skip to content

Commit

Permalink
Renamed searchBar to textFieldSearchBar. Fixed #1430
Browse files Browse the repository at this point in the history
  • Loading branch information
hackiftekhar committed Oct 8, 2018
1 parent b36bd79 commit b0418a1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion IQKeyboardManager/Categories/IQUIView+Hierarchy.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
/**
Returns searchBar if receiver object is UISearchBarTextField, otherwise return nil.
*/
@property (nullable, nonatomic, readonly) UISearchBar *searchBar;
@property (nullable, nonatomic, readonly) UISearchBar *textFieldSearchBar;

/**
Returns YES if the receiver object is UIAlertSheetTextField, otherwise return NO.
Expand Down
4 changes: 2 additions & 2 deletions IQKeyboardManager/Categories/IQUIView+Hierarchy.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ -(BOOL)_IQcanBecomeFirstResponder

if (_IQcanBecomeFirstResponder == YES)
{
_IQcanBecomeFirstResponder = ([self isUserInteractionEnabled] && ![self isHidden] && [self alpha]!=0.0 && ![self isAlertViewTextField] && !self.searchBar);
_IQcanBecomeFirstResponder = ([self isUserInteractionEnabled] && ![self isHidden] && [self alpha]!=0.0 && ![self isAlertViewTextField] && !self.textFieldSearchBar);
}

return _IQcanBecomeFirstResponder;
Expand Down Expand Up @@ -376,7 +376,7 @@ -(NSString *)debugHierarchy
return debugInfo;
}

-(UISearchBar *)searchBar
-(UISearchBar *)textFieldSearchBar
{
UIResponder *searchBar = [self nextResponder];

Expand Down
8 changes: 4 additions & 4 deletions IQKeyboardManager/IQKeyboardManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ -(void)adjustPosition
CGFloat specialKeyboardDistanceFromTextField = textFieldView.keyboardDistanceFromTextField;

{
UISearchBar *searchBar = textFieldView.searchBar;
UISearchBar *searchBar = textFieldView.textFieldSearchBar;

if (searchBar)
{
Expand Down Expand Up @@ -1929,7 +1929,7 @@ -(void)previousAction:(IQBarButtonItem*)barButton

//Handling search bar special case
{
UISearchBar *searchBar = currentTextFieldView.searchBar;
UISearchBar *searchBar = currentTextFieldView.textFieldSearchBar;

if (searchBar)
{
Expand Down Expand Up @@ -1967,7 +1967,7 @@ -(void)nextAction:(IQBarButtonItem*)barButton

//Handling search bar special case
{
UISearchBar *searchBar = currentTextFieldView.searchBar;
UISearchBar *searchBar = currentTextFieldView.textFieldSearchBar;

if (searchBar)
{
Expand Down Expand Up @@ -2003,7 +2003,7 @@ -(void)doneAction:(IQBarButtonItem*)barButton

//Handling search bar special case
{
UISearchBar *searchBar = currentTextFieldView.searchBar;
UISearchBar *searchBar = currentTextFieldView.textFieldSearchBar;

if (searchBar)
{
Expand Down
4 changes: 2 additions & 2 deletions IQKeyboardManagerSwift/Categories/IQUIView+Hierarchy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public extension UIView {
}

if _IQcanBecomeFirstResponder == true {
_IQcanBecomeFirstResponder = isUserInteractionEnabled == true && isHidden == false && alpha != 0.0 && isAlertViewTextField() == false && searchBar() == nil
_IQcanBecomeFirstResponder = isUserInteractionEnabled == true && isHidden == false && alpha != 0.0 && isAlertViewTextField() == false && textFieldSearchBar() == nil
}

return _IQcanBecomeFirstResponder
Expand All @@ -270,7 +270,7 @@ public extension UIView {
/**
Returns searchBar if receiver object is UISearchBarTextField, otherwise return nil.
*/
internal func searchBar()-> UISearchBar? {
internal func textFieldSearchBar()-> UISearchBar? {

var responder : UIResponder? = self.next

Expand Down
8 changes: 4 additions & 4 deletions IQKeyboardManagerSwift/IQKeyboardManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
var invocation = barButton.invocation
//Handling search bar special case
do {
if let searchBar = textFieldRetain.searchBar() {
if let searchBar = textFieldRetain.textFieldSearchBar() {
invocation = searchBar.keyboardToolbar.previousBarButton.invocation
}
}
Expand Down Expand Up @@ -622,7 +622,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
var invocation = barButton.invocation
//Handling search bar special case
do {
if let searchBar = textFieldRetain.searchBar() {
if let searchBar = textFieldRetain.textFieldSearchBar() {
invocation = searchBar.keyboardToolbar.nextBarButton.invocation
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
var invocation = barButton.invocation
//Handling search bar special case
do {
if let searchBar = textFieldRetain.searchBar() {
if let searchBar = textFieldRetain.textFieldSearchBar() {
invocation = searchBar.keyboardToolbar.doneBarButton.invocation
}
}
Expand Down Expand Up @@ -979,7 +979,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
//Maintain keyboardDistanceFromTextField
var specialKeyboardDistanceFromTextField = textFieldView.keyboardDistanceFromTextField

if let searchBar = textFieldView.searchBar() {
if let searchBar = textFieldView.textFieldSearchBar() {

specialKeyboardDistanceFromTextField = searchBar.keyboardDistanceFromTextField
}
Expand Down

0 comments on commit b0418a1

Please sign in to comment.