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

Commit 0622f6f

Browse files
GianniCarlojessesquires
authored andcommitted
Updated canPerformAction:withSender: in JSQMessagesComposerTextView to call super (#1664). Fixes #1663.
1 parent ef5c87f commit 0622f6f

1 file changed

Lines changed: 2 additions & 29 deletions

File tree

JSQMessagesViewController/Views/JSQMessagesComposerTextView.m

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -226,35 +226,8 @@ - (BOOL)becomeFirstResponder
226226
return [super becomeFirstResponder];
227227
}
228228

229-
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
230-
{
229+
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
231230
[UIMenuController sharedMenuController].menuItems = nil;
232-
233-
if ([self.text length] == 0) {
234-
if (action == @selector(paste:)) {
235-
return YES;
236-
}
237-
} else {
238-
NSRange range = self.selectedRange;
239-
if (range.length > 0) {
240-
if (action == @selector(cut:)
241-
|| action == @selector(copy:)
242-
|| action == @selector(select:)
243-
|| action == @selector(selectAll:)
244-
|| action == @selector(paste:)
245-
|| action ==@selector(delete:)) {
246-
return YES;
247-
}
248-
}
249-
else {
250-
if (action == @selector(select:)
251-
|| action == @selector(selectAll:)
252-
|| action == @selector(paste:)) {
253-
return YES;
254-
}
255-
}
256-
}
257-
return NO;
231+
return [super canPerformAction:action withSender:sender];
258232
}
259-
260233
@end

0 commit comments

Comments
 (0)