The Assets Library Module

This recipe uses the assets library module. Be sure to add it to your source file with @import AssetsLibrary.

Using the assets library may sound complicated, but there are strong underlying reasons why this is a best practice for working with image pickers. An image picker may return an asset URL without providing a direct image to use. Recipe 8-1 assumes that this is a possibility and offers a method to load an image from the assets library (loadImageFromAssetURL:into:). A typical URL looks something like this:

assets-library://asset/asset.JPG?id=553F6592-43C9-45A0-B851-28A726727436&ext=JPG

This URL provides direct access to media.

Fortunately, Apple has now moved past an extremely annoying ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.