How to Use Xcode to Develop an iOS App - dummies

How to Use Xcode to Develop an iOS App

By Jesse Feiler

To develop an iPhone, iPod touch, or iPad app, you have to work within the context of an Xcode project. Xcode supports the following activities that are parts of developing your app:

  • Creating an Xcode project

  • Developing the app (designing the user interface using a storyboard, coding, and running and debugging the code)

  • Tuning app performance

  • Distributing the app

Creating an Xcode project

To develop an iOS app, you start by creating an Xcode project. A project contains all the elements needed to create an app, including the source files, a graphical representation of the user interface, and build settings needed to build your app.

You work on your project in the Workspace window, which allows you to create all of these elements as well as build, run, debug, and submit your app to the App Store.

Developing the app

You have a lot to do to develop an app. You need to design the user experience and then implement what you came up with as a user interface. You need to write code to implement the features of the app. You also need to test and debug the app.

Designing the user interface using a storyboard

Xcode’s Interface Builder is the editor you use to assemble your app’s user interface with the help of preconfigured objects found in the Library. The objects include windows, controls (such as switches, text fields, and buttons), and the views you’ll use, such as Image, Web, and Table views.

The Interface Builder editor allows you to add objects, configure their properties, and create connections not only between user interface objects, but also between user interface objects and your code.

When you use a storyboard, most of if not all your screens end up being displayed in the storyboard, and Interface Builder saves your storyboard in a storyboard file (with the extension). When you don’t use a storyboard, each screen is saved separately as a nib file (with the extension). Either way, these files contain all the information iOS needs to reconstitute the user interface objects in your app.

Interface Builder saves you time and effort when it comes to creating your app’s user interface. You don’t have to code each object (which saves you a lot of work), and what’s more, because Interface Builder is a visual editor, you get to see what your app’s user interface will look like at runtime.


To code, you use the Source Code editor, which supports features such as code completion, syntax-aware indentation, and source code folding (to hide “code blocks” temporarily). You can get context-based help to assist you, and if you need information about a particular symbol, you can either get a summary of a symbol’s documentation directly in the editor, or you can opt for more extensive documentation.

Xcode’s Live Issues and Fix-it features work together to point out mistakes as you enter your code and offer to fix those mistakes for you.

Running and debugging

When you run your app to debug or test it, you can run it in the iOS Simulator on your Mac and then on an iOS-based device (if you’re in the developer program). Using the simulator, you can make sure your app behaves the way you want. You can also get debugging information — as you run — in the Debug area.

By running your app on a device connected to your Mac (still using the debugger, if you like), you can observe the actual user experience and see how the app will perform.

Tuning app performance

As you are running your app, gauges show you the amount of memory you’re using, what’s happening in your app’s iCloud sandbox, how you’re doing on energy consumption (a critical issue for mobile devices), network activity, and more. The clear, graphical interface of the gauges is a major new feature of Xcode 5.

Distributing the app

Xcode provides various kinds of app distribution, including

  • Ad hoc distribution for testing on up to 100 iOS devices.

  • The App Store for distributing to hundreds of millions of iOS device users. You can give your apps away for free or let Apple sell them for you.

  • Custom B2B Apps for distributing business-to-business apps directly to your business customers who have a Volume Purchase Program account.

You create an archive of your app that contains debugging information, making it easier to track down bugs reported by testers (and users) of your app. When your app is ready to go, you submit it to the App Store. (Before you submit your app to the store, you even run some of the same software-validation procedures on your app that Apple does.)