- (void)viewDidLoad
{
[super viewDidLoad];
@weakify(self);
// Add a gesture recognizer to a view
UITapGestureRecognizer *tap = [UITapGestureRecognizer new];
[tap.rac_gestureSignal subscribeNext:^(id x) {
@strongify(self);
[self.tableView endEditing:YES]; // This will dismiss the keyboard
}];
tap.cancelsTouchesInView = NO;
[self.tableView addGestureRecognizer:tap];
}
Last active
August 29, 2015 14:26
-
-
Save xareelee/19e9393a633b93e037f4 to your computer and use it in GitHub Desktop.
Dismiss keyboard when tapping table view (or content view) using ReactiveCocoa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment