Book Image

Xcode 6 Essentials

By : Jayant Varma
Book Image

Xcode 6 Essentials

By: Jayant Varma

Overview of this book

<p>Apple made their iOS devices easy to use and now they have extended that to their development tools such as Xcode. In Xcode, you can create native applications in the easiest way. Apple's new Xcode technology is making the development curve smoother with its easy-to-develop features and enhancements.</p> <p>Xcode can now write code with the performance-upgraded, brand new, innovative language called Swift, so you no longer need to rely on third-party frameworks to create applications.</p> <p>The book gives you a tour of the new features of Xcode 6. It introduces some important aspects such as the Swift language and its Playgrounds with visual live coding, creating interfaces, storyboards, controllers, frameworks, and live previews. Diving more into the subject, this books shows you how to debug your code, and how to build and test the application on a device or the simulator.</p>
Table of Contents (15 chapters)

Preface

Welcome to Xcode 6 Essentials. Development has moved on from the realm of computer science students to practically everyone. A couple of decades ago, computers were expensive and hard to use and now everyone has one in their pockets. Similarly, developmental tools have also changed and made life easier and allowed people from many other aspects to get with developing. With the popularity of iOS devices and Macs, the lure of being the App Store millionaire appeals to one and all. With a growing number of developers using Xcode, Apple has been adding a lot of features to it. In 2014, Apple released Xcode 6 and Swift. This book will cover using Xcode, and the language of choice is Swift. This book will take the reader through the various aspects of Xcode that might be important to use. The book employs a combination of a step-by-step approach and a theory approach to help the reader develop.

What this book covers

Chapter 1, Introduction to Xcode, introduces what Xcode is all about. It helps you install Xcode, if you do not have it on your system, and set it up for use.

Chapter 2, Tour of Xcode, offers a quick tour of the Xcode UI, the various panels, windows, and settings. This is what you will interact with on a regular basis when developing. It is helpful to know the shortcuts, what each displays, and how to activate or deactivate the windows.

Chapter 3, Playgrounds, takes you through a quick journey of Swift, allowing you to learn Swift interactively using the new feature called Playgrounds. This allows you to see the results of your commands and variables; your code is run in the background with no need to compile and run it.

Chapter 4, Interface Builder, introduces Interface Builder and Storyboards. It further helps non-developers or beginners to create applications with little to no code. This can also be used to create functional mock-ups as required.

Chapter 5, Custom Controls, introduces another new feature added to Xcode: the inclusion of custom controls and live previews. This chapter helps you understand the stub of a custom control and then add code. It further explains how to create this as a framework.

Chapter 6, Debugging, helps you as you progress and write your code, given the possibility of errors creeping in. Powerful debugging tools are introduced; they will help you understand where to look for basic help and will set up breakpoints, monitor variables, and quick look values.

Chapter 7, Building and Running, helps you understand the next step after creating your application: packaging it for distribution to the App Store. After going through this chapter, you will have run a full life cycle introduction to creating an application for iOS devices using Xcode.

Appendix, Conditional Execution and Interface Designing, has some interesting gotchas and tips for using Xcode more efficiently and also learning how the current versions differ from previous versions of Xcode and SDK.

What you need for this book

To be able to run the code and work through the chapter step-by-step, you will need the following:

  • An Apple computer running OS X 10.9 or higher

  • Xcode 6.x installed on this Apple computer

Who this book is for

This book is aimed at intermediate developers who have little to no experience with iOS SDK. It will also be useful to those who want to get up-to-speed with the new features of Xcode briefly. A basic understanding of programming logic is necessary and any experience with iOS is beneficial. It also introduces and uses Swift, a new language, and will be helpful to those who want a quick introduction to Swift.

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, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "New UIAlertController is introduced to replace the older UIAlertView."

A block of code is set as follows:

var name: String = "XCode Esentials"
var version: Int = 1.0
var title = "\(name) - ver (\version)"
println("The book is \(title)")

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

var width: Int = 200
var height: Int = 200
@IBInspectable theColor: UIColor = UIColor.redColor() 
var title: String = "Untitled"

Any command-line input or output is written as follows:

# po UIScreen().bounds

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: "Clicking on the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

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 via 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/submit-errata, 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

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.