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)

The basics


At the very base, all visual elements are derived from the UIView object described in UIKit. A custom control is basically a custom class that is derived from a UIView class and is responsible for displaying itself visually on the screen.

Some controls such as the stock ticker will display the data based on the stocks that you might want to track. In the case of a progress bar, however, you might want to set the progress and then also retrieve the progress status at some point.

Creating a class

First, let us start with the basics; we will create a class and give it some properties. Since this is a visual class, we will need to derive it from UIView. Perform the following steps:

  1. Start a new project and name it customControl1:

  2. Click on Main.storyboard to open it in the editor and then drag a view control onto the View Controller scene. This will be the placeholder for our custom control. Since the view has a white background and so does our scene, it is a little difficult to see white...