Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
Remove canPerformAction:withSender: from JSQMessagesComposerTextView
Browse files Browse the repository at this point in the history
This will list all the default actions plus any custom actions that have been registered in the demo
  • Loading branch information
GianniCarlo committed Jun 10, 2016
1 parent 29fd810 commit cfa5872
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions JSQMessagesViewController/Views/JSQMessagesComposerTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,36 +290,4 @@ - (BOOL)becomeFirstResponder
{
return [super becomeFirstResponder];
}

- (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;
}

@end

0 comments on commit cfa5872

Please sign in to comment.