Skip to content

Commit 5edd386

Browse files
author
Eric Millin
committed
Merge pull request appium-boneyard#12 from 0x1mason/swipe
Added ability to close keyboard with swipe gesture
2 parents fb6bd23 + 8d5de28 commit 5edd386

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,21 @@ - (void)viewDidLoad
6868
[computeSumButton setAccessibilityIdentifier:@"ComputeSumButton"];
6969
[answerLabel setAccessibilityIdentifier:@"Answer"];
7070
[locationStatus setAccessibilityIdentifier:@"locationStatus"];
71+
72+
UISwipeGestureRecognizer * swipe =[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeUp:)];
73+
swipe.direction = UISwipeGestureRecognizerDirectionUp;
74+
[self.view addGestureRecognizer:swipe];
75+
[swipe release];
7176

7277
computeSumButton.titleLabel.text = NSLocalizedString(@"main.button.computeSum", @"Compute Sum button");
7378
}
7479

80+
-(void)swipeUp:(UISwipeGestureRecognizer*)gestureRecognizer
81+
{
82+
[secondArg resignFirstResponder];
83+
}
84+
85+
7586
- (void)logLocationAuthFromTimer:(NSTimer *)timer
7687
{
7788
[self logLocationAuth];

0 commit comments

Comments
 (0)