views:

201

answers:

1

I'm interested in responding to when the user performs a standard Copy to the generalPasteboard as part of the default UIWebView control. I'd like to take some action in response to this.

Is this possible, or would I need to re-implement a custom copy control so that I can be sure to capture the event?

+2  A: 

The UIPasteboard documentation on the changeCount property details what happens when a item is copied to the pasteboard.

UIPasteboard posts the notifications named UIPasteboardChangedNotification (for additions and modifications) and UIPasteboardRemovedNotification (for removals). These notifications include (in the userInfo dictionary) the types of the pasteboard items added or removed.

You will then want to subscribe to the UIPasteboardChangedNotification through the NSNotificationCenter:addObserver:selector:name:object: method.

groundhog