Getting Started with iOS Development

We build professional apps for Android, iOS and mobile web.
Have a look

Developing for iOS can be a daunting process for those with no background in app development.

What are these storyboards and how do they work? Why do I see the word ‘views' everywhere? Where is the physical app being built?

If you have these questions, hopefully I can help clarify. Just like learning a new language, learning to develop for iOS is something you can come to understand and eventually be comfortable with.

My first recommendation is to consider using Swift instead of Objective-C, as it’s basic syntax is likely more familiar to those with no prior experience in Objective-C. I'll be using Swift in the examples.

If you are unsure what tools you need to get started, install Xcode available only on MAC OS X. It has all the necessary components you will need for making apps.

However, I won’t be covering the basics and fundamentals of programming, this is for those with some experience.

Now, to cover the questions you might have brewing:

Interface builder

The interface builder handles the physicality when creating an app. It provides a way of viewing what your app will look like (unless you have code overriding it) and is a simply and easy way to create it. There is no programming involved when interacting with the Interface Builder, until you make things such as ‘outlets’ or ‘actions’. Outlets and actions connect up the components you create on an Interface builder to your code, allowing you to program them inside your editor.

Interface builder is drag and drop, but it’s a good tool for displaying the app. This is especially important when working with others. Views (which we will come to next) can be inserted here. Each of those rectangles are views themselves too.

Views

This word will get thrown around a lot if you develop for iOS so I am going to tell you a bit about them. Views are what is used to create and customise your app. They can be tweaked, added and changed through code and the Interface Builder. These views allow developers to add buttons, images, labels and additional objects to their app. Think of the view as the canvas for our work!

Other than the standard view, which can contain separate components, other views exist. These include table views, text views, image views and scroll views. Their functions are pretty self-explanatory.

Coding with the Interface Builder

Now that hopefully you understand the basics of the Interface builder, how does it come together with code?

As mentioned earlier, outlets and actions are among the ways to edit our app programmatically. Outlets allows us to change the component from code, and actions allow us to execute some sort of code when the component (such as a button) has been interacted with by a user.

First we wire up outlets to a variable, or actions to a function. We do this by selecting the component, then holding Ctrl + Left Mouse Click, dragging into our editor and letting go. You will need to see both the Interface Builder and Editor to do so. In Xcode this can be done by selecting Assistant Editor located in the top right of Xcode.

The iOS SDK provides plenty of functions for us to tweak our components with. For example, for a standard view we can change the background colour with ease.

someView.backgroundColor = UIColor.redColor()

This code won't reflect in the Interface Builder - the view will still be it's original background colour. However, it will show when the app is launched. We can change the background colour in the Interface Builder too if we choose. It's important to note that what is done programmatically will override what has been done in the IB.

Another option is actions. Using the same wiring up process as earlier, except we set the connection to 'action'. Now we can do something when this component is interacted with.

@IBAction func buttonClicked(sender: AnyObject) { \\ Write your code here! Xcode creates this function for you when it's wired up. }

And that's it for now! I hope this helped your understanding of iOS development.