Book Image

iOS 5 Essentials

By : Steven F. Daniel
Book Image

iOS 5 Essentials

By: Steven F. Daniel

Overview of this book

Building on the phenomenal success of its predecessor iOS 5 includes over 200 new user features as well as an updated SDK containing over 1,500 new APIs. iOS 5 looks set to reinforce the iPhone's dominance in the smartphone market. iOS 5 Essentials will help you learn how to build simple, yet powerful iOS 5 applications incorporating iCloud Storage, Twitter, Core Image and Newsstand integration. You will start by learning about what's new in iOS 5. You'll look at the iCloud Storage APIs, Automatic Reference Counting, Twitter and AirPlay integration, how to use the various Core Image filters using the Cocoa framework, and the new features of the iOS 5 SDK. After this, you'll jump straight in and create applications using Xcode and Interface Builder using the new storyboard layout. We then finish up by learning how to make your applications run smoothly using the Xcode instruments.
Table of Contents (16 chapters)

Preface

Building on the phenomenal success of its predecessor, iOS 5 includes over 200 new user features as well as an updated SDK containing over 1,500 new APIs. iOS 5 looks set to reinforce the iPhone's dominance in the smartphone market.

iOS 5 Essentials will help you learn how to build simple, yet powerful iOS 5 applications, incorporating iCloud Storage, Twitter, Core Image and Newsstand integration.

You will start by learning about what's new in iOS 5. You'll look at the iCloud Storage APIs, Automatic Reference Counting, Twitter, and AirPlay integration, how to use the various Core Image filters using the Cocoa framework, and the new features of the iOS 5 SDK. After this, you'll jump straight in and create applications using Xcode and Interface Builder using the new storyboard layout. We then finish up by learning how to make your applications run smoothly using the Xcode instruments.

In this book, I have tried my best to keep the code simple and easy-to-understand. I have provided step-by-step instructions with loads of screenshots at each step to make it easier to follow. You will soon be mastering the different aspects of iOS 5 programming, as well as mastering the technology and skills needed to create some stunning applications. Feel free to contact me at for any queries, or just want to say 'hello'. Any suggestions for improving this book will be highly regarded.

What this book covers

Chapter 1, What's New in iOS5, introduces the developer to the Xcode developer set of tools, the new features of iOS 5, as well as an introduction into Newsstand and the MessageUI framework.

Chapter 2, Using iCloud and the Storage APIs, introduces you to the benefits of using iCloud, and how to incorporate iCloud functionality into your applications to store and retrieve files, and its data through the use of the storage APIs. This chapter will also give you some insight into how to go about handling file-version conflicts when multiple copies of the same file are being updated on more than one iOS device.

Chapter 3, Debugging with OpenGL ES, focuses on the differences between vertex shaders and fragment shaders, and their relationship with one another. We will become familiar with the OpenGL ES 2.0 Programmable pipeline, and look into the new debugging features of OpenGL ES that enables us to track down issues specific to OpenGL ES, right within the Xcode IDE. We will learn more about the OpenGL ES frame capture tool and its ability to stop execution of a program, that will enable the developer to grab the current frame contents that are being rendered on the iOS device, so that program issues can be tracked down and corrected, by taking a closer look at the program state information of objects, by scrolling through the debug navigator stack trace with the ability to see all of the textures and shaders that are currently being used by the application.

Chapter 4, Using Storyboards, gains an understanding of what Storyboards are and how we can apply the various transitions between views. We will take a look into how we are able to create and configure scenes and storyboard files, to present these programmatically. We will also look at how to go about building and integrating Twitter capabilities into our application to tweet photos and standard messages.

Chapter 5, Using AirPlay and Core Image, focuses on learning about the AirPlay and Core Image frameworks, and how we go about using and implementing these into our applications. This chapter also explains the different image filter effects, how to adjust the brightness of an image, as well as how to go about producing a water ripple effect. It also covers how to incorporate AirPlay functionality into your application, so that you can have your application displayed out to an external device, such as an Apple TV.

Chapter 6, Xcode Tools - Improvements, focuses on learning about the improvements that have been made to the Xcode development tools. We will take a look at Automatic Reference Counting (ARC), which is the latest addition that has been made to the LLVM compiler, and how this can help improve application performance, by minimizing issues with our applications. It also covers improvements that have been made to Interface Builder, the iOS Location simulator, and the set of debugging tools for OpenGL ES.

Chapter 7, Making your Applications Run Smoothly Using Instruments, focuses on how we can effectively use Instruments within our applications to track down memory leaks and bottlenecks within our applications that could potentially cause our application to crash on the user's iOS device. We will take a look into each of the different types of built-in instruments that come as part of the Instruments application, learn how we can use the System Trace instrument to monitor system calls, and track down performance issues within an application.

What you need for this book

This book assumes that you have an Intel-based Macintosh running Snow Leopard (Mac OS X 10.6.2, or later). You can use Leopard, but I would highly recommend upgrading to Snow Leopard or Lion, as there are many new features in Xcode that are available only to these two operating systems.

We will be using Xcode 4.2.1, which is the integrated development environment used for creating applications for iOS development. You can download the latest version of Xcode at the following link: http://developer.apple.com/xcode/.

Who this book is for

If you ever wanted to learn about the latest features of iOS 5 and learn how to incorporate Twitter, iCloud and Core Image framework effects functionality into your applications, then this book is for you. You should have a good knowledge of programming experience with Objective-C, and have used Xcode 4. iOS programming experience is not required.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Launch Xcode from the /Developer/Applications folder."

A block of code is set as follows:

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>

@interface MyEmailAppViewController: UIViewController<MFMailComposeViewControllerDelegate> {} 
@end

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<plist version="1.0">
  <dict>
    <key>application-identifier</key>
    <string>AXEUZ3F6VR.com.geniesoftstudios</string>
    <key>com.apple.developer.ubiquity-container-identifiers</key>
    <array>
      <string>TEAMID.com.yourcompany.iCloudExample</string>
    </array>
    <key>com.apple.developer.ubiquity-kvstore-identifier</key>
    <string>TEAMID.com.yourcompany.iCloudExample</string>
    <key>get-task-allow</key>
    <true/>
  </dict>
</plist>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "When Xcode is launched, you should see the Welcome to Xcode screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.