Book Image

Application Development in iOS 7

By : Kyle Begeman
Book Image

Application Development in iOS 7

By: Kyle Begeman

Overview of this book

Table of Contents (15 chapters)
Application Development in iOS 7
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Asset catalogs


Every project you create will contain at least a few image files in the form of launch images and application icons as well as other UI elements. Asset catalogs serve two major purposes in Xcode 5. These include automation of icon and launch image naming conventions and grouping image files together in a single location.

Asset catalogs are represented as a separate group with a blue folder in the project navigator. By default, each new project created will include the default Images.xcassets item. You may also create your own asset catalogs for further organization based on personal preference.

Xcode 5 requires each of the launch image files and icon image files to be named appropriately based on the device and/or resolution the image will be used for. When selecting the Images.xcassets item, you will see a number of empty slots waiting for images to be added. Each slot has a description of what image it holds. Dragging from your computer into Xcode 5 on the respective slot will add the image to your project and automatically configure all the naming conventions. The following screenshot shows the Asset Catalog window:

If you wish to add any additional images related to your project, you can simply drag-and-drop them into the Asset Catalog window, and Xcode 5 will take care of the rest. Both high-resolution (2x) and standard-resolution (1x) image files will be grouped together in their own image set with a common name. You still must provide both the low-resolution and high-resolution images yourself. Xcode 5 does not automatically scale them for you: it simply groups them. The value for this name can be changed to any value and will be used in code to access the associated images regardless of the actual filename.