diff --git a/JSQMessagesViewController/Views/JSQMessagesComposerTextView.m b/JSQMessagesViewController/Views/JSQMessagesComposerTextView.m index a4aef5a89..6a3471ea1 100644 --- a/JSQMessagesViewController/Views/JSQMessagesComposerTextView.m +++ b/JSQMessagesViewController/Views/JSQMessagesComposerTextView.m @@ -226,35 +226,8 @@ - (BOOL)becomeFirstResponder return [super becomeFirstResponder]; } -- (BOOL)canPerformAction:(SEL)action withSender:(id)sender -{ +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { [UIMenuController sharedMenuController].menuItems = nil; - - if ([self.text length] == 0) { - if (action == @selector(paste:)) { - return YES; - } - } else { - NSRange range = self.selectedRange; - if (range.length > 0) { - if (action == @selector(cut:) - || action == @selector(copy:) - || action == @selector(select:) - || action == @selector(selectAll:) - || action == @selector(paste:) - || action ==@selector(delete:)) { - return YES; - } - } - else { - if (action == @selector(select:) - || action == @selector(selectAll:) - || action == @selector(paste:)) { - return YES; - } - } - } - return NO; + return [super canPerformAction:action withSender:sender]; } - @end