Guide To Building Your First Mobile App

 Guide To Building Your First Mobile App

When I was first getting into mobile app development, there were a lot of resources on the internet for building Android apps but not so many for iOS. There was talk of Apple’s developer program being expensive and difficult to get accepted into. All in all, it seemed like a bigger roadblock than how I felt it should have been. So, while some people were claiming that you couldn’t build “real” apps without a Mac and paying $99 a year for an account with Apple, I had made my first app, The Moron Test, entirely on Windows using only free tools.

Well, over three years later and after having built numerous apps, here are my thoughts now:

  • You can absolutely make great iOS apps without spending a dime. You can even make them on a PC or Mac if you want (I don’t recommend it).
  • It’s not hard to get accepted into Apple’s developer program and there’s no reason why you should feel like you’re getting scammed by the process, as long as you apply for an individual account and not a company account.
  • Because of this, it is true that your app will most likely be rejected at some point in its life cycle (it happened with one of my apps) but rejections are never personal and they aren’t like rejections from publishers. If they say “no”, ask them exactly what they think is wrong and how you could fix it before making any changes so that way when your next version is submitted, it will be much more likely to get accepted.
  • You don’t have to have a Mac to do iOS development but you are able to save yourself some money if you know how to use XCode and Interface Builder on your PC or Mac already.
  • There aren’t as many free tools for iOS as there are for Android (in my opinion) and sometimes this can make things harder but the experience usually ends up being worth it in the end.

So those of you that might want to try writing an app yourself but were scared off by some of the misinformation about iOS development floating around, hopefully, this article helps show that making apps is probably easier than most people think and definitely within reach of anyone willing to put in the time to learn. And now, without any more rambling, here is an excellent resource for getting started with iOS development:

Welcome to the wonderful world of Apple-flavored Objective-C. It’s not hard, especially if you’re familiar with C or Java, but it can be a little confusing at first. If you want to skip the theory and get right into making your app then this guide will help you out. I’ve broken down each step into pretty straightforward tasks that are easy enough for even beginners to figure out. So let’s get started!

The absolute first thing you’ll need is XCode 4 which is what you use to develop iOS apps on your computer. Unless your company pays for your developer account (or you’re one of those people that bought the new Mac Pro) you’ll need to download it for free using your Apple Developer Connection account. This is pretty simple if you’ve ever downloaded anything from iTunes before, but if not then here are step-by-step instructions:

  1. Go to https://developer.apple.com/xcode/ and click “Downloads” in the top menu bar. You only have to sign up once so after this point you won’t have to do it again until your membership expires.
  2. Click on “XCode 4” under Downloads > Mac OS X Lion > Development Tools > Command Line Tools . Choose either 32-bit or 64-bit depending your computer’s settings (not your iOS devices) and hit Download.
  3. You’ll most likely get a popup with an error saying it couldn’t connect to the server, like this: “The page isn’t redirecting properly”. Don’t worry about it though because clicking OK will give you another chance to download XCode 4 successfully.
  4. After you’ve successfully downloaded it (or if you already have), launch the installer and follow the prompts to install it on your computer. It’s that simple! For more detailed instructions just visit https://developer.apple.com/xcode/ .

Note: To be able to run iOS apps during development, they must be run in what is called “Simulator” which is included in XCode 4 so don’t worry about buying a physical iOS device yet since you’ll be using Simulator for now anyways.

After you’ve downloaded XCode 4, there’s one more step that I recommend before moving on to the next section which is downloading the “Interface Builder” plugin for XCode. This allows you to design your app’s screens in a different program without constantly having to switch back and forth between two programs. If you don’t care about this then feel free to move onto the next section where we will actually write our first line of code! But if you do…

  1. Go to https://developer.apple.com/xcode/downloads/ , click on “Command Line Tools”, then “+” under El Capitan , then download and install “Interface Builder”.
  2. After XCode 4 finishes installing, launch it from your Applications folder.
  3. It will ask you to select a workspace, this is just where all of the project files are saved so pick anywhere that is easy for you to remember. For most people I would recommend using something similar to “MyProjects” or even your user name (i.e. JohnApp or JohnnyApp). As long as you don’t use any spaces in the title then everything should work fine 🙂
  4. Once XCode has finished loading up, click on “Create a new Xcode project” under the text that says “Welcome to Xcode.” A new window will pop up with two tabs at the top, one with a list of project types, and the other saying “iOS.” Click on “Single View Application” under iOS .
  5. A new window will pop-up asking you where to save your project. Pick somewhere easy for you to remember since this is where your XCode projects are saved by default. Type in the name you want for your project (I recommend something close to what you plan on naming your app) then click Save.
  6. The first thing that pops up after clicking Save is choosing options for what device orientations you want your app to support (only authorized users can see this image). If authorized users didn’t see an option for all orientations then don’t worry about it since we’re just using Simulator anyways which doesn’t support all screen orientations. Click the Portrait button if it is present, otherwise just click Next .
  7. Now you get new options for what type of project template to use and the name of your project. Make sure “Single View Application” is selected on the left, enter a new name for your project (I used LearnToBuild ), then click Next .
  8. This next window will let you set up some settings for your brand new app. For Product Name use a short description of what your app does then choose iPhone from the Devices drop-down menu and Swift from Language drop-down menu. Once everything looks good, click Next , then save again when asked where to put the project files.
  9. Finally you get to choose where to save the file for your brand new app. Just like in previous steps, pick a place that’s easy for you to remember and hit Save. After hitting Save XCode should automatically open up a new window titled “ViewController.swift” where we will be writing our code! Congrats, you’ve just created an app! Isn’t it exciting? If not then don’t worry about it because this is all part of the learning process 🙂

Note: For those who are using Xcode 8 or newer, click on “Main. storyboard” under Navigation Controller Scene. It will ask if you want to configure storyboards, click No. Then when asked whether you want Storyboard to be the Default, click No. Make sure that “Use Auto Layout” is checked, then close the storyboard.

  1. Now that all of the coding stuff is out of the way, let’s go ahead and make it look pretty! To do this you must first download the image files for this tutorial here . Once downloaded extract these images to an easy-to-find location on your computer. You should have 6 image files in total including one titled “empty_state.png.” There will also be a folder titled “RedHanded” which contains 4 additional images we’ll be using later on. After you’ve downloaded and extracted all of your image files, open up XCode and navigate to ViewController.swift where we’ll be adding our code.
  2. To add our images we will be using the AssetsLibrary framework which allows us to quickly and easily load images from app bundles (since we can’t write to the disk, we must create an app bundle in order to access these image files). Auto Layout isn’t needed for this tutorial so feel free to turn it off if you like by clicking on Main.storyboard and unchecking “Use Auto Layout.” Also make sure that View is selected in the upper Left-hand corner of XCode next to the blue play button before moving on.

Stephanie Hoffman

Related post