now hide keyboard when enter is pressed

This commit is contained in:
Diego Waxemberg
2014-10-20 21:45:37 -04:00
parent af43539015
commit 9e8903402b
4 changed files with 16 additions and 1 deletions

View File

@@ -11,7 +11,7 @@
#import "PairManager.h"
#import "StreamConfiguration.h"
@interface MainFrameViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate, MDNSCallback, NSURLConnectionDelegate, PairCallback>
@interface MainFrameViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate, MDNSCallback, NSURLConnectionDelegate, PairCallback, UITextFieldDelegate>
@property (strong, nonatomic) IBOutlet UIPickerView *HostPicker;
- (IBAction)StreamButton:(UIButton *)sender;
- (IBAction)PairButton:(UIButton *)sender;

View File

@@ -174,6 +174,15 @@ static StreamConfiguration* streamConfig;
// Dispose of any resources that can be recreated.
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
- (BOOL)shouldAutorotate {
return YES;
}

View File

@@ -54,6 +54,9 @@
<rect key="frame" x="374" y="235" width="276" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="wb7-af-jn8" id="YMu-2k-Dyk"/>
</connections>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>

View File

@@ -48,6 +48,9 @@
<rect key="frame" x="82" y="179" width="156" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="dgh-JZ-Q7z" id="DCy-4m-RHG"/>
</connections>
</textField>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0xb-lk-PHK">
<rect key="frame" x="0.0" y="307" width="320" height="162"/>