Chapter 7. Photos and videos and the Assets Library

 

This chapter covers

  • Using the image picker controller
  • Retrieving assets from the Assets Library
  • Capturing photos and videos with the image picker
  • Retrieving and displaying asset metadata

You created an application using the Assets Library framework when you created the Albums app. This application allowed you to view the photos contained within albums managed by the Photos app on iOS. Truth is, you only scratched the surface of what you can do with the Assets Library in the Albums app. You only retrieved albums and photos so that you could use them to be displayed within a table and collection view.

By the end of this chapter you’ll be able to capture photos or videos using the camera, use the built-in photo picker, and access the detailed bits of information contained within each photo or video. Some of this information includes EXIF information for photos and duration and location information for videos. Together we’ll be using this knowledge to put together an app called Media Info that will allow you to do all of these things; you can see it in action in figure 7.1.

Figure 7.1. Your finished Media Info app will allow you to choose and capture media and view detailed asset information.

We’ll look at an extended overview of the Assets Library, and then we’ll set up the foundation for your new application.

7.1. Overview of the Assets Library framework

7.2. Retrieving photos and videos with the image picker

7.3. Capturing photos and videos with the camera

7.4. Retrieving assets and accessing metadata

7.5. Summary