Skip to content

Commit 571d277

Browse files
committed
Fixes UISearchBar Issue
2 parents 3f3ce7a + 22e0451 commit 571d277

File tree

12 files changed

+235
-169
lines changed

12 files changed

+235
-169
lines changed

IQKeyboardManager Framework/KeyboardManager.framework/Versions/A/Headers/IQKeyboardManager.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@
201201
*/
202202
+ (id)new __attribute__((unavailable("new is not available in IQKeyboardManager, Use sharedManager")));
203203

204-
205-
206-
207204
@end
208205

209206

Binary file not shown.

KeyboardTextFieldDemo/IQKeyBoardManager/IQToolbar.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#import "IQToolbar.h"
2525
#import "IQKeyboardManagerConstantsInternal.h"
2626
#import "IQTitleBarButtonItem.h"
27+
#import "IQUIView+Hierarchy.h"
28+
29+
#import <UIKit/UIViewController.h>
2730

2831
@implementation IQToolbar
2932
@synthesize titleFont = _titleFont;
@@ -62,6 +65,22 @@ - (id)initWithCoder:(NSCoder *)coder
6265
return self;
6366
}
6467

68+
69+
-(CGSize)sizeThatFits:(CGSize)size
70+
{
71+
CGSize sizeThatFit = [super sizeThatFits:size];
72+
73+
UIView *view = [[self viewController] view];
74+
75+
if (view)
76+
{
77+
//Issue #52 fix
78+
sizeThatFit.width = [[[self viewController] view] width];
79+
}
80+
81+
return sizeThatFit;
82+
}
83+
6584
//To resize IQToolbar on device rotation.
6685
- (void) layoutSubviews
6786
{

KeyboardTextFieldDemo/IQKeyBoardManager/IQUIView+Hierarchy.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ - (NSArray*)deepResponderViews
130130

131131
for (UITextField *textField in subViews)
132132
{
133-
if ([textField canBecomeFirstResponder])
133+
if ([textField canBecomeFirstResponder] && ![textField isAlertViewTextField] && ![textField isSearchBarTextField])
134134
{
135135
[textFields addObject:textField];
136136
}
@@ -145,7 +145,7 @@ - (NSArray*)deepResponderViews
145145

146146
-(BOOL)isSearchBarTextField
147147
{
148-
return [self isKindOfClass:UISearchBarTextFieldClass];
148+
return ([self isKindOfClass:UISearchBarTextFieldClass] || [self isKindOfClass:[UISearchBar class]]);
149149
}
150150

151151
-(BOOL)isAlertViewTextField

KeyboardTextFieldDemo/IQKeyBoardManager/IQUIView+IQKeyboardToolbar.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ - (void)addDoneOnKeyboardWithTarget:(id)target action:(SEL)action titleText:(NSS
137137
50 done button frame.
138138
8 distance maintenance
139139
*/
140-
buttonFrame = CGRectMake(0, 0, toolbar.frame.size.width-50.0-8, 44);
140+
buttonFrame = CGRectMake(0, 0, toolbar.frame.size.width-64.0-12.0, 44);
141141
}
142142
else
143143
{

KeyboardTextFieldDemo/IQKeyboard.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
9D94D34118D1811000CE5ED0 /* KeyboardManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D94D34018D1811000CE5ED0 /* KeyboardManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
3636
9D9A0FC318C9DB5700585D3F /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D9A0FC218C9DB5700585D3F /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
3737
9D9A0FC518C9DB5F00585D3F /* Twitter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D9A0FC418C9DB5F00585D3F /* Twitter.framework */; };
38-
9DC4CE3018DAF77300DB2CB0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DC4CE2E18DAF77300DB2CB0 /* Main.storyboard */; };
3938
9DF8A9E118BB5ED8008E93B8 /* IQKeyboardManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AFF236BD17CA224400760F6C /* IQKeyboardManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
4039
9DF8A9E218BB5ED8008E93B8 /* IQKeyboardManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AFF236BE17CA224400760F6C /* IQKeyboardManager.m */; };
4140
9DF8A9E318BB5ED8008E93B8 /* IQToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0BB81C18BB18AA00667349 /* IQToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -62,10 +61,11 @@
6261
C07E20BE18590085001699A8 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C07E20BA18590085001699A8 /* WebViewController.m */; };
6362
C07E20C3185900BD001699A8 /* TextFieldViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C07E20C1185900BD001699A8 /* TextFieldViewController.m */; };
6463
C080A59318740EFF0088441B /* TextViewSpecialCaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C080A59118740EFF0088441B /* TextViewSpecialCaseViewController.m */; };
64+
C0AB9307195F57BB00447049 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DC4CE2E18DAF77300DB2CB0 /* Main.storyboard */; };
65+
C0AB9308195F57CE00447049 /* IQKeyboard-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DFD56AB18BCB281001007A2 /* IQKeyboard-Info.plist */; };
6566
C0B63BA01781FAB1008D3B64 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0B63B9F1781FAB1008D3B64 /* UIKit.framework */; };
6667
C0B63BA21781FAB1008D3B64 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0B63BA11781FAB1008D3B64 /* Foundation.framework */; };
6768
C0B63BA41781FAB1008D3B64 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0B63BA31781FAB1008D3B64 /* CoreGraphics.framework */; };
68-
C0B63BAA1781FAB1008D3B64 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C0B63BA81781FAB1008D3B64 /* InfoPlist.strings */; };
6969
C0B63BAC1781FAB1008D3B64 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B63BAB1781FAB1008D3B64 /* main.m */; };
7070
C0B63BB01781FAB1008D3B64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B63BAF1781FAB1008D3B64 /* AppDelegate.m */; };
7171
/* End PBXBuildFile section */
@@ -133,6 +133,7 @@
133133
C07E20C1185900BD001699A8 /* TextFieldViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextFieldViewController.m; sourceTree = "<group>"; };
134134
C080A59018740EFF0088441B /* TextViewSpecialCaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextViewSpecialCaseViewController.h; sourceTree = "<group>"; };
135135
C080A59118740EFF0088441B /* TextViewSpecialCaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextViewSpecialCaseViewController.m; sourceTree = "<group>"; };
136+
C0AB930A195F5A5900447049 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
136137
C0B63B9B1781FAB1008D3B64 /* IQKeyboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IQKeyboard.app; sourceTree = BUILT_PRODUCTS_DIR; };
137138
C0B63B9F1781FAB1008D3B64 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
138139
C0B63BA11781FAB1008D3B64 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -474,12 +475,12 @@
474475
isa = PBXResourcesBuildPhase;
475476
buildActionMask = 2147483647;
476477
files = (
478+
C0AB9308195F57CE00447049 /* IQKeyboard-Info.plist in Resources */,
479+
C0AB9307195F57BB00447049 /* Main.storyboard in Resources */,
477480
9D3FBD2F18C5A8D6006591CB /* original.jpg in Resources */,
478481
9D3FBD3218C5A8D6006591CB /* [email protected] in Resources */,
479482
9D3FBD3018C5A8D6006591CB /* [email protected] in Resources */,
480-
9DC4CE3018DAF77300DB2CB0 /* Main.storyboard in Resources */,
481483
9D3FBD3318C5A8D6006591CB /* icon57.png in Resources */,
482-
C0B63BAA1781FAB1008D3B64 /* InfoPlist.strings in Resources */,
483484
9D3FBD3118C5A8D6006591CB /* icon60.png in Resources */,
484485
AF4301BA179E92C400FADAC6 /* [email protected] in Resources */,
485486
9DF8AA3918BB6305008E93B8 /* IQKeyboardManager.bundle in Resources */,
@@ -580,6 +581,7 @@
580581
children = (
581582
9DC4CE3118DAF77700DB2CB0 /* Base */,
582583
9DC4CE3318DAF7F200DB2CB0 /* es */,
584+
C0AB930A195F5A5900447049 /* en */,
583585
);
584586
name = Main.storyboard;
585587
sourceTree = "<group>";
@@ -657,7 +659,6 @@
657659
9D0BB88018BB232B00667349 /* Debug */ = {
658660
isa = XCBuildConfiguration;
659661
buildSettings = {
660-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
661662
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
662663
CLANG_CXX_LIBRARY = "libc++";
663664
CLANG_ENABLE_MODULES = YES;
@@ -684,7 +685,6 @@
684685
9D0BB88118BB232B00667349 /* Release */ = {
685686
isa = XCBuildConfiguration;
686687
buildSettings = {
687-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
688688
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
689689
CLANG_CXX_LIBRARY = "libc++";
690690
CLANG_ENABLE_MODULES = YES;

0 commit comments

Comments
 (0)