About Asset Catalogs
Use asset catalogs to simplify management of images that are used by your app as part of its user interface.
An asset catalog can include:
Image sets: Used for most types of images, an image set contains all the versions, or representations, of an image that are necessary to support various devices and scale factors.
App icons: App icon sets contain all the representations of the icon that iOS apps must provide to be displayed on a device’s Home screen and in the App Store.
Launch images: Launch image sets contain all the representations of the static launch image that iOS apps must provide to be temporarily displayed when the app is launched.
OS X Icons: OS X icon sets contain all the representations of an icon that OS X apps must provide.
View and customize the contents of asset catalogs using three main areas:
Set list: See a list of all image sets, app icon sets, and image launch sets in the selected asset catalog.
Set viewer: View the individual image representations for the selected set.
Set attributes inspector: Depending on what’s selected in the Set viewer, you can either edit a set’s name and supported devices, or view the properties of an image representation.
Each set in an asset catalog has a name. You can use that name to programmatically load any individual image contained in the set. To load an image, call the
UIImage:ImageNamed: method, passing the name of the set that contains the image.
Xcode 5 provides different functionality for asset catalogs depending on the deployment target for your project:
For all projects, individual images can be loaded using set names.
For projects with a deployment target of iOS 7, Xcode compiles your asset catalogs into a runtime binary file format that reduces the download time for your app.
Each asset catalog in Xcode has a corresponding folder in the Finder, with an .xcassets extension, and subfolders for each set. Each set folder in turn contains its image representations, along with a
contents.json file, describing each image. That file is automatically created by Xcode.
You can share asset catalogs across multiple projects in the same workspace.
The first time you open an existing project with Xcode 5, the project is evaluated to see whether any settings should be updated. If a project has no asset catalog, Xcode 5 creates one automatically.