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

Fix crash on delete pressed for JSQMessagesComposerTextView #1664

Merged
merged 1 commit into from Jun 10, 2016

Conversation

GianniCarlo
Copy link
Contributor

Pull request checklist

  • All tests pass. Demo project builds and runs.
  • I have resolved any merge conflicts.
  • I have followed the coding style, and reviewed the contributing guidelines. Confirmation: 💪😎👊

This fixes issue #1663.

What's in this pull request?

Fixes the crash on delete menu button pressed

@codecov-io
Copy link

codecov-io commented Jun 9, 2016

Current coverage is 60.97%

Merging #1664 into develop will decrease coverage by 0.03%

@@            develop      #1664   diff @@
==========================================
  Files            62         62          
  Lines          2264       2265     +1   
  Methods         637        638     +1   
  Messages          0          0          
  Branches        137        137          
==========================================
  Hits           1381       1381          
- Misses          811        812     +1   
  Partials         72         72          

Sunburst

Powered by Codecov. Last updated by 7130853...346d215

@jessesquires jessesquires added this to the 7.3.3 milestone Jun 10, 2016
@jessesquires
Copy link
Owner

Thanks @GianniCarlo ! 👍

@jessesquires
Copy link
Owner

Hm, after looking at iMessage, delete isn't even an option.

I think we should remove delete: altogether from the menu.

@jessesquires
Copy link
Owner

jessesquires commented Jun 10, 2016

In fact, shouldn't we just call super in canPerformAction: withSender: ?

then we wouldn't need to enumerate all those selectors....

@GianniCarlo
Copy link
Contributor Author

you are right @jessesquires , if we remove the canPerformAction: withSender: from the JSQMessagesComposerTextView the actions listed are the default plus there's a custom action registered for the demo. As it is now it won't show that custom action

@GianniCarlo
Copy link
Contributor Author

Updated pull request

@jessesquires
Copy link
Owner

Here's what I'm suggesting:

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {    
    [UIMenuController sharedMenuController].menuItems = nil;
    return [super canPerformAction:action withSender:sender];
}

wouldn't this fix the crash and keep the fix from #1281?

@GianniCarlo
Copy link
Contributor Author

oooh, hadn't seen that issue, yup then the function is indeed needed, I'll update it now

@GianniCarlo
Copy link
Contributor Author

updated 👍

@jessesquires
Copy link
Owner

Awesome. So this fixes the crash, and still fixes #1281?

@GianniCarlo
Copy link
Contributor Author

yes, fixes the crash as the default list of actions doesn't include the action delete. And [UIMenuController sharedMenuController].menuItems = nil; takes care of #1281

@jessesquires
Copy link
Owner

Thanks so much for jumping on this so quickly @GianniCarlo ! 🎉

@jessesquires jessesquires merged commit 6b711ea into jessesquires:develop Jun 10, 2016
jessesquires pushed a commit that referenced this pull request Jun 10, 2016
@jessesquires
Copy link
Owner

cherry-picked into release_7.3

Slessi pushed a commit to preeo/JSQMessagesViewController that referenced this pull request Aug 22, 2016
Luke47 pushed a commit to ubergrape/JSQMessagesViewController that referenced this pull request Jan 30, 2017
pcoltau added a commit to TeletronicsDotAe/JSQMessagesViewController that referenced this pull request Apr 16, 2017
…iewController

* 'master' of https://github.com/jessesquires/JSQMessagesViewController: (86 commits)
  ImageOptim on assets (jessesquires#1845)
  update changelog and spec for 7.3.4
  Fix issue jessesquires#1583: Don't highlight cell outside message bubble (when long press) (jessesquires#1744)
  update changelog and version for 7.3.3
  Updated `canPerformAction:withSender:` in `JSQMessagesComposerTextView` to call super (jessesquires#1664). Fixes jessesquires#1663.
  Update CHANGELOG and version nums for 7.3.2
  fix KVO crash. close jessesquires#1631
  formatting
  small fix regarding scrollToIndexPath (jessesquires#1642) close jessesquires#1640
  Update CHANGELOG.md
  update CHANGLOG. bump version numbers
  Reverted jessesquires#1588 to fix jessesquires#1602 and fix jessesquires#1604. (jessesquires#1623)
  bump version numbers
  Update CHANGELOG.md
  provide default init values for JSQMessagesCollectionViewLayoutAttributes to prevent assertion. fix jessesquires#1338
  follow up for jessesquires#1247 and jessesquires#1591. obfuscate private APIs. swizzle via +initialize
  copy attributes
  clean up
  fix keyboard hiding bug on iOS 9 (jessesquires#1307). fix jessesquires#1063
  - cleanup from PR jessesquires#1281 - fix menu actions, close jessesquires#1321 - make notification methods public - partially apply changes from PR jessesquires#1563
  ...
pcoltau added a commit to TeletronicsDotAe/JSQMessagesViewController that referenced this pull request Apr 16, 2017
…nch3

* origin/master: (66 commits)
  ImageOptim on assets (jessesquires#1845)
  update changelog and spec for 7.3.4
  Fix issue jessesquires#1583: Don't highlight cell outside message bubble (when long press) (jessesquires#1744)
  update changelog and version for 7.3.3
  Updated `canPerformAction:withSender:` in `JSQMessagesComposerTextView` to call super (jessesquires#1664). Fixes jessesquires#1663.
  Update CHANGELOG and version nums for 7.3.2
  fix KVO crash. close jessesquires#1631
  formatting
  small fix regarding scrollToIndexPath (jessesquires#1642) close jessesquires#1640
  Update CHANGELOG.md
  update CHANGLOG. bump version numbers
  Reverted jessesquires#1588 to fix jessesquires#1602 and fix jessesquires#1604. (jessesquires#1623)
  bump version numbers
  Update CHANGELOG.md
  provide default init values for JSQMessagesCollectionViewLayoutAttributes to prevent assertion. fix jessesquires#1338
  follow up for jessesquires#1247 and jessesquires#1591. obfuscate private APIs. swizzle via +initialize
  copy attributes
  clean up
  fix keyboard hiding bug on iOS 9 (jessesquires#1307). fix jessesquires#1063
  - cleanup from PR jessesquires#1281 - fix menu actions, close jessesquires#1321 - make notification methods public - partially apply changes from PR jessesquires#1563
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants