Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
By now, it should come as no surprise to you that the iPhone and iPod touch each have a built-in camera (which the current iPad unfortunately lacks) and a nifty application called Photos to help you manage all those awesome pictures and videos you've taken. What you may not know is that your programs can use the built-in camera to take pictures and that your programs can also allow the user to select from among the media already stored on the device.
Because of the way iOS applications are sandboxed, applications ordinarily can't get to photographs or other data that live outside of their own sandboxes. Fortunately, both the camera and the media library are made available to your application by way of an image picker. As the name implies, an image picker is a mechanism that lets you select an image from a specified source. At the time this class first appeared in iOS, it was only used for images. Nowadays you can use it to capture video just as well. Typically, an image picker will use a list of images and/or videos as its source (see the left of Figure 18–1). You can, however, specify that the picker use the camera as its source (see the right of Figure 18–1).