What's new in Xcode 6?

Xcode has been around for a while, and it was at WWDC 2014 that Xcode 6 was introduced. There were a couple of new features that were introduced in Xcode, and we will explore some of them in this book along with the standard features.

The first important thing that Apple introduced is a new Language called Swift (detailed in Chapter 3, Playgrounds). Since the days of NeXT, when Steve Jobs returned to Apple, Macs has been using the Objective-C language to write applications for the Mac environment. With the introduction of iPhone, Apple introduced their PhoneSDK, which allowed developers to write apps for their phones using Objective-C. This was later named iOS, as the devices were not just phones. Like any language, Objective-C has its own set of followers and haters. With the uptake of iOS devices, many users wanted to try their hand at developing apps. However, Objective-C largely remained a hurdle so they considered other options. At WWDC 2014, Apple unveiled a new language they had been working on, called Swift. Swift is an easy-to-learn-and-use language that looked more like a scripting language than a structured C variant. The code looked smaller and more manageable.

The most important bit was that there was no more memory management in the form of alloc and retain statements. To add to this, the introduction to Swift by Apple mentioned, "Semi-colons are optional".

Interactive coding using Playgrounds

Apple also introduced a feature called Playgrounds. This allows you as the developer to quickly type in your commands in an editor, like you would write in a text editor or Microsoft Word. The Playground compiles, runs, and displays the results of each line of code that is typed. This topic is further detailed in Chapter 3, Playgrounds.

Tip

There is an open source project that runs your Objective-C code like Playgrounds. So you can simply alter your code in the editor and the running application is altered on the fly. This is not part of this book but could be interesting for some advanced users.

Mac OS X storyboards

Before storyboards, there were XIB files that described the user interface or the form in XML format. Apple introduced the storyboard, which allowed users to define the relationship between the elements, mainly to direct the workflow. This was originally introduced only for iOS projects, but with Xcode 6, storyboards are now available for OS X projects too. This is detailed in Chapter 4, Interface Builder.

Live design and responsive UI

In earlier versions of Xcode, there was little control over debugging and testing controls you created. Now, Apple offers a way to interact with your controls while in design mode in Interface Builder.

Xcode now offers new functionality to allow you to create a single storyboard that would adapt to different screen sizes with the help of size classes and autolayout. They are detailed in Chapter 4, Interface Builder.

Visual debugging

When debugging your code, Xcode can now display variables and objects visually. This helps make debugging much simpler and easy to use. It also offers functionality to provide custom previews for your own classes/objects while debugging. They are detailed in Chapter 5, Custom Controls.

Improved debugger

Even the debugger has some new features added to it. Some of these allow you to test and optimize your code and eliminate errors, including visual debugging with a hierarchical view of the views and elements on the screen. This is detailed in Chapter 6, Debugging.

In addition to these, we will also cover some of the other features that were present in earlier versions, which are equally important in getting things done.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset