Book Image

Xcode 4 Cookbook

By : Steven F. Daniel
Book Image

Xcode 4 Cookbook

By: Steven F. Daniel

Overview of this book

<p>The release of iOS 6 comes packed with over 1,500 new APIs and 200 new features. Xcode 4 Cookbook will teach youhow to integrate iCloud storage and how to go about using the Facebook and OpenGraphi APIs, as well as providing you with practical step-by-step recipes covering User Interfaces, data management, multimedia, localisation services and maps, right through to application deployment to the Apple App Store. You will soon be mastering the technology and the skills needed to create some amazing applications.<br /><br />"Xcode 4 Cookbook" will help you learn how to build some powerful applications using iOS 6 and the various frameworks. You will soon master how to incorporate iCloud, Facebook, and the OpenGraph APIs and apply various image filters and transitions using Core Image integration within your applications. By using the book’s step-by-step approach, you will soon master the technology and the skills needed to create some amazing applications.<br /><br />"Xcode 4 Cookbook" provides you with the skills and knowledge and practical recipes on how to go about developing useful applications that can be used within the industry.<br /><br />You will start by learning how to go about downloading and installing the Xcode Development Tools, learn about Interface Builder to create the visual user interfaces, connecting the objects using Outlets and Actions, and learn how to compile/debug your applications.<br /><br />Finally, you will learn how to capture media with the iOS camera and play back video content using Airplay to wirelessly stream videos to an Apple TV device, using the AV Foundation framework, as well as using the Core Image and Core Graphics frameworks to create amazing image effects using the built-in features.</p>
Table of Contents (19 chapters)
Xcode 4 Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Using Interface Builder to create the user interface


In this recipe, we will familiarize ourselves with the Interface Builder application. Interface Builder is a visual tool that enables you to design the user interface for your iOS applications.

Using Interface Builder, you are able to drag-and-drop views and objects onto your canvas area from the libraries pane. These objects can then be connected using outlets and actions so that they can programmatically interact with your code.

How to do it…

To display our view controller within Interface Builder and the Xcode environment, perform the following simple steps:

  1. Select the ViewController.xib file from the project navigator window.

  2. From the Xcode toolbar, select the viewing options, as shown in the following screenshot:

In the preceding screenshot, this shows what Interface Builder looks like when an XIB file has been chosen from the project navigator window.

How it works…

Whenever you use Interface Builder to design a user interface, any objects that have been used from the library pane will be connected to the Xcode project that they belong to.

As you can see from the preceding screenshot, the Interface Builder workspace is divided into three main areas. The following table provides a brief description of which area is used for what functions:

Area name

Description

Navigation area

This area displays all files associated with the project.

Editor area

This area is where we start to design our user interface from.

Inspector pane

This area is where we can configure each of our objects.

Library pane

This area is where we can locate objects and drag them onto our view. Such objects are the UILabel, UIButton, UITextField, and so on.

There's more…

You may have noticed the section called Simulated Metrics located on the Attributes tab within the inspector pane window. This area shows you how our interface will look like within the designer, and eventually how it will look like when it is deployed and run on the iOS device.

Here you can specify whether your interface will have a status bar, toolbar, or even a navigation bar. It is worth mentioning that, if you set the Status Bar option to None, it does not mean that our application will start without a status bar.

Note

The status bar is the bar that appears at the top of the device's screen and displays certain types of information to the user, such as the current time, battery status, carrier name, and so forth.

See also

  • The Building the user interface for our application recipe

  • The Creating outlets to Interface Builder objects recipe

  • The Adding and customizing views recipe in Chapter 2, User Interfaces – Creating the UI