From 7a6c87c6ea678da809a0571c2e71851fea13a366 Mon Sep 17 00:00:00 2001 From: Ayaka Nonaka Date: Tue, 24 Jun 2014 11:36:55 -0700 Subject: [PATCH] Update sample app to show resignFirstResponder. --- VENTokenFieldSample/Base.lproj/Main.storyboard | 10 ++++++++++ VENTokenFieldSample/ViewController.m | 8 +++++++- VENTokenFieldSampleTests/VENTokenFieldSampleTests.m | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/VENTokenFieldSample/Base.lproj/Main.storyboard b/VENTokenFieldSample/Base.lproj/Main.storyboard index 9ba0319..d72add4 100644 --- a/VENTokenFieldSample/Base.lproj/Main.storyboard +++ b/VENTokenFieldSample/Base.lproj/Main.storyboard @@ -31,6 +31,16 @@ + diff --git a/VENTokenFieldSample/ViewController.m b/VENTokenFieldSample/ViewController.m index e9619a4..76a0cf4 100644 --- a/VENTokenFieldSample/ViewController.m +++ b/VENTokenFieldSample/ViewController.m @@ -30,6 +30,11 @@ - (IBAction)didTapCollapseButton:(id)sender [self.tokenField collapse]; } +- (IBAction)didTapResignFirstResponderButton:(id)sender +{ + [self.tokenField resignFirstResponder]; +} + #pragma mark - VENTokenFieldDelegate @@ -39,7 +44,8 @@ - (void)tokenField:(VENTokenField *)tokenField didEnterText:(NSString *)text [self.tokenField reloadData]; } -- (void)tokenField:(VENTokenField *)tokenField didDeleteTokenAtIndex:(NSUInteger)index { +- (void)tokenField:(VENTokenField *)tokenField didDeleteTokenAtIndex:(NSUInteger)index +{ [self.names removeObjectAtIndex:index]; [self.tokenField reloadData]; } diff --git a/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m b/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m index 95b6b69..89746d9 100644 --- a/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m +++ b/VENTokenFieldSampleTests/VENTokenFieldSampleTests.m @@ -38,4 +38,11 @@ - (void)testBasicFlow [tester waitForAbsenceOfViewWithAccessibilityLabel:@"Octocat,"]; } +- (void)testResignFirstResponder +{ + [tester tapViewWithAccessibilityLabel:@"To"]; + [tester tapViewWithAccessibilityLabel:@"Resign First Responder"]; + [tester waitForAbsenceOfKeyboard]; +} + @end