Skip to content

Commit

Permalink
Revert #52 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hackiftekhar committed Jul 18, 2014
1 parent 6cf4b13 commit ea5e50e
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 24 deletions.
28 changes: 14 additions & 14 deletions KeyboardTextFieldDemo/IQKeyBoardManager/IQToolbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ - (id)initWithCoder:(NSCoder *)coder
}


-(CGSize)sizeThatFits:(CGSize)size
{
CGSize sizeThatFit = [super sizeThatFits:size];
UIView *view = [[self viewController] view];

if (view)
{
//Issue #52 fix
sizeThatFit.width = [[[self viewController] view] width];
}

return sizeThatFit;
}
//-(CGSize)sizeThatFits:(CGSize)size
//{
// CGSize sizeThatFit = [super sizeThatFits:size];
//
// UIView *view = [[self viewController] view];
//
// if (view)
// {
// //Issue #52 fix
// sizeThatFit.width = [view width];
// }
//
// return sizeThatFit;
//}

//To resize IQToolbar on device rotation.
- (void) layoutSubviews
Expand Down
4 changes: 2 additions & 2 deletions KeyboardTextFieldDemo/IQKeyboard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@
"DEBUG=1",
);
INFOPLIST_FILE = "KeyboardTextFieldDemo/IQKeyboard-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = IQKeyboard;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
Expand All @@ -851,7 +851,7 @@
GCC_PREFIX_HEADER = "KeyboardTextFieldDemo/IQKeyboard-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "";
INFOPLIST_FILE = "KeyboardTextFieldDemo/IQKeyboard-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = IQKeyboard;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="En3-R6-bks">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="QVL-Vx-sY9">
<dependencies>
<deployment version="1280" defaultVersion="1280" identifier="iOS"/>
<deployment version="1536" defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -543,11 +543,11 @@
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<view contentMode="scaleToFill" id="SHK-82-xFg">
<rect key="frame" x="10" y="91" width="310" height="210"/>
<rect key="frame" x="10" y="91" width="316" height="210"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="k8L-Hj-hKb">
<rect key="frame" x="10" y="5" width="290" height="74"/>
<rect key="frame" x="10" y="5" width="296" height="74"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="TextField 1" minimumFontSize="17" id="LhW-1m-VYd">
Expand All @@ -568,7 +568,7 @@
<color key="backgroundColor" red="1" green="0.50196081399917603" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</view>
<view contentMode="scaleToFill" id="uYv-to-iCC">
<rect key="frame" x="10" y="129" width="290" height="76"/>
<rect key="frame" x="10" y="129" width="296" height="76"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="TextField 4" minimumFontSize="17" id="yDj-sx-3pn">
Expand All @@ -579,7 +579,7 @@
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" tag="103" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="TextField 5" minimumFontSize="17" id="cub-N3-8xz">
<rect key="frame" x="10" y="40" width="264" height="30"/>
<rect key="frame" x="10" y="40" width="266" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="tintColor" red="0.28746597428324966" green="0.4522703921823798" blue="0.47692340353260865" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand All @@ -589,11 +589,11 @@
<color key="backgroundColor" red="1" green="0.80000001192092896" blue="0.40000000596046448" alpha="1" colorSpace="calibratedRGB"/>
</view>
<view contentMode="scaleToFill" id="uOD-xJ-Vjb">
<rect key="frame" x="10" y="84" width="290" height="41"/>
<rect key="frame" x="10" y="84" width="296" height="41"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="TextField 3" minimumFontSize="17" id="UJZ-io-mQK">
<rect key="frame" x="10" y="5" width="267" height="30"/>
<rect key="frame" x="10" y="5" width="272" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="tintColor" red="0.42113987790245616" green="0.2545063021333267" blue="0.47692340353260865" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand All @@ -614,6 +614,36 @@
</objects>
<point key="canvasLocation" x="620" y="700"/>
</scene>
<!--View Controller-->
<scene sceneID="zX2-4D-TZp">
<objects>
<viewController id="QVL-Vx-sY9" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Aw6-Gy-mgx">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<containerView contentMode="scaleToFill" id="0VU-zE-2wB">
<rect key="frame" x="37" y="74" width="207" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<connections>
<segue destination="5Pq-2R-iNF" kind="embed" id="kKg-oX-Zkq"/>
</connections>
</containerView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="BPG-oc-2Mm">
<rect key="frame" x="37" y="388" width="207" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="1" green="0.59999999999999998" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cPe-ef-M3O" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-190" y="-675"/>
</scene>
<!--Web View Controller - UIWebView Example-->
<scene sceneID="MtW-0i-ACI">
<objects>
Expand Down Expand Up @@ -764,6 +794,47 @@
</objects>
<point key="canvasLocation" x="-168" y="-2"/>
</scene>
<!--View Controller-->
<scene sceneID="Duq-GD-Sy1">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" id="5Pq-2R-iNF" sceneMemberID="viewController">
<view key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="rfC-VV-oI5">
<rect key="frame" x="0.0" y="0.0" width="207" height="282"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="w3D-lx-Xgb">
<rect key="frame" x="0.0" y="20" width="207" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="69v-0I-9vb">
<rect key="frame" x="0.0" y="71" width="207" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="icJ-q4-15m">
<rect key="frame" x="0.0" y="133" width="207" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="LQq-QQ-JYq">
<rect key="frame" x="0.0" y="193" width="207" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="0.16078431900000001" green="0.74901962280000001" blue="0.60392159219999997" alpha="1" colorSpace="deviceRGB"/>
</view>
<toolbarItems/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5d0-SZ-G7A" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="213" y="-576"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
Expand Down
19 changes: 19 additions & 0 deletions KeyboardTextFieldDemo/KeyboardTextFieldDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@ -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)
}
}

-(BOOL)shouldAutorotate
{
return NO;
}

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}

@end

0 comments on commit ea5e50e

Please sign in to comment.