Added ability to intercept -[UITextView paste:] #1136
Conversation
…r intercepting pastes. Added demo to demo app of pasting an image from the UIPasteboard.
Not quite sure why that build failed. It's some weird issue with DerivedData... |
@harlanhaskins - nice! 👍 |
* A delegate used to forward custom notifications from `JSQMessagesComposerTextView`. | ||
*/ | ||
@protocol JSQMessagesComposerTextViewDelegate <NSObject> | ||
@optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this non-optional.
My thought was that the delegate could be used for more than just pasting, but I'll definitely make those changes first thing tomorrow. I'm using this fork for Bryx 911 now and it's working great! |
|
@harlanhaskins - awesome! 👍 Regarding optional vs non-optional delegates: there are basically 2 methods to solve this kind of problem.
With (2), you can achieve optionality by allowing the delegate to be |
I luv the way you bork a repo ;) |
@wdcurry 😆 |
Updated the demo for the new naming.
I went ahead and updated it. Should be ready to merge! |
@@ -18,6 +18,8 @@ | |||
|
|||
#import "DemoMessagesViewController.h" | |||
|
|||
@interface DemoMessagesViewController () <JSQMessagesComposerTextViewPasteDelegate> | |||
@end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this to the header file.
Hey @harlanhaskins ! I was about to merge and noticed a couple more changes. Also, for doc comments, there should be 2 spaces after the
After this, I'll merge! 😄 Thanks again! 👍 |
Thanks @harlanhaskins ! 😄 🎉 |
Added ability to intercept -[UITextView paste:]
@harlanhaskins - Just tested. This is awesome. Submit more PRs plz. 😁 |
Added JSQComposerTextViewDelegate with optional method for intercepting pastes.
Added demo to demo app of pasting an image from the UIPasteboard.