Skip to content

farhanpatel/YIPopupTextView

 
 

Repository files navigation

YIPopupTextView

facebook's post-like input text view for iOS.

ScreenShot1

How to use

// 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.

License

YIPopupTextView is available under the Beerware license.

About

facebook's post-like input text view for iOS (Beerware license)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.8%
  • Ruby 1.2%