facebook's post-like input text view for iOS.
// NOTE: maxCount = 0 to hide count
YIPopupTextView* popupTextView = [[YIPopupTextView alloc] initWithPlaceHolder:@"input here" maxCount:1000];
popupTextView.delegate = self;
popupTextView.caretShiftGestureEnabled = YES; // default = NO
popupTextView.text = self.textView.text;
//popupTextView.editable = NO; // set editable=NO to show without keyboard
[popupTextView showInView:self.view];
#pragma mark YIPopupTextViewDelegate
- (void)popupTextView:(YIPopupTextView *)textView willDismissWithText:(NSString *)text cancelled:(BOOL)cancelled
{
NSLog(@"will dismiss: cancelled=%d",cancelled);
}
//
// NOTE:
// You can add your custom-button after calling -showInView:
// (it's better to add on either superview or superview.superview)
// https://github.com/inamiy/YIPopupTextView/issues/3
//
// [popupTextView.superview addSubview:customButton];
//
For caret-shifting
, it is better to use YISwipeShiftCaret for all UITextField/UITextViews.
YIPopupTextView is available under the Beerware license.