Skip to content

mikeahmarani/MADismissiveTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MADismissiveTextView

MADismissiveTextView is a drop-in UITextView subclass that handles dismissing the keyboard with your finger, just like in the Messages.app.

Usage

MADismissiveTextView is designed to be used in tandem with a UIScrollView as well as its UIPanGestureRecognizer. As such, this class only works with iOS 5.0 and up.

Example

UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 44, 320, 416)];
[self.view addSubview:scrollView];

MADismissiveTextView *textView = [[MADismissiveTextView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
textView.dismissivePanGestureRecognizer = scrollView.panGestureRecognizer;
textView.keyboardDelegate = self;
[self.view addSubview:textView];

Dismissive Keyboard Delegate

The MADismissiveKeyboardDelegate protocol allows you to make changes to your UI at key moments during the animation of the UIKeyboard. These delegate methods are all optional.

- (void)keyboardDidShow;
- (void)keyboardDidScroll:(CGPoint)keyboardOrigin;
- (void)keyboardWillBeDismissed;
- (void)keyboardWillSnapBack;

About

A drop in UITextView subclass that handles dismissing the keyboard with your finger, just like in the Messages.app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published