Chapter 11. The Pasteboard
WHAT'S IN THIS CHAPTER?
Items you can place on the UIPasteboard
Identifying and performing cut, copy, and paste operations
Customizing menu items on the iPad
With the introduction of iPhone OS 3.0, users were able to copy text, images, or other data in one application and paste that data to either another location within the same application or a different application.
Note
If you're getting confused by references between iPhone and iPad here, remember this: At this time, the iPad is the only device that allows the developer to customize the standard Cut, Copy, Paste editing menu. The iPhone works with only the options that Apple gives the developer.
The copy-cut-paste process is included in the following:
UITextViewUITextFieldUIWebView
The UIKit framework provides the following classes and protocols that provide the architecture so you can implement cut, copy, and paste in your applications:
The
UIPasteboardclass provides pasteboards, allowing for the sharing of data within an application or between applications by writing and reading data to and from a pasteboard.The
UIMenuControllerclass displays the editing menu, allowing selected items to be copied, cut, or pasted into the pasteboard.The
UIResponderclass declares the methodcanPerformAction:withSender:, which determines what editing commands appear on the menu.The
UIResponderStandardEditActionsclass is invoked when the user taps one of the commands in the editing menu.
In this chapter you will learn how ...