Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions UIViewController+KeyboardAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ @implementation UIViewController (KeyboardAnimation)
- (void)an_subscribeKeyboardWithAnimations:(ANAnimationsWithKeyboardBlock)animations
completion:(ANCompletionKeyboardAnimations)completion {
[self an_subscribeKeyboardWithBeforeAnimations:nil animations:animations completion:completion];
//tap guesture and swipe down guesture to close view
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)]];
UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
[swipeDown setDirection:UISwipeGestureRecognizerDirectionDown];
[self.view addGestureRecognizer:swipeDown];
}

- (void) hideKeyboard{
[self.view endEditing:true];
}

- (void)an_subscribeKeyboardWithBeforeAnimations:(ANBeforeAnimationsWithKeyboardBlock)beforeAnimations
Expand Down