How To Take Your First App Project From Start To Finish

Written by: Reinder de Vries, April 26 2017, in App Development

How To Take Your First App Project From Start To Finish

You’ve learned how to code, and now it’s time to move on to your first app project. Where do you start? How do you develop the project? Let’s find out!

Learning how to code is only worth it if you’re actually going to do something with your newfound skill. Why bother learning how to cook if you’re never going to be a chef?

Same for coding: you want to try your skills at a new project, but… how do you move from learning how to code, to actually building something?

In this article I’d like to guide you through the steps that take you from learning how to code to completing your first code project. It’s a question I get a lot from aspiring coders: “I’ve learned to code, but now what?” Read on, because this article has the answer.

What you’re about to learn can help you regardless of skill, and it doesn’t matter if you’ve already learned how to code, or if you’re still learning. Doing your own code projects, for fun or for profit, is one of the best ways to learn to code and to improve your expertise.

Chapter reference:

Ready? Let’s do this.

Note: Looking for a fun app project? Check out the different coding guides here on LearnAppMaking.com.

Start With a Simple, Basic Idea

Start with a simple, basic idea. This is very important! You won’t be creating a Facebook or Instagram straight after you’ve written “Hello world!” for the first time.

Setting the right expectations is part of creating the right learning environment for yourself, and that includes not setting expectations that are too high.

Think about it: set your expectations too high, get stuck on a programming problem that you can’t solve easily, and you might as well give up… That’s not what you want.

What are good app project ideas?

  • A to-do app. This is about as “cliché” as it’s going to get, and with good reason. A to-do list app is the perfect app project to learn working with table views, app navigation, and app data storage.
  • A simple game. You don’t have to build just productivity or utility app projects – they can be fun too! What about a game app? Build something simple, like an arcade game, or a top-down shooter like Asteroids. Avoid games that involve complex logic, like multiplayer games or strategy-intensive games like chess.
  • A chat app, chat bot, or iMessage app. This is the least ideal app project to start with, but it’s fun and challenging. Create a chat app with Firebase, a chat bot for Messenger, or an iMessage integration. Keep in mind that these projects are less “contained”, i.e. they require you to integrate with external tools like Facebook Apps and back-ends, so they might be too challenging.

Don’t worry if an app is already invented, or exists already in the App Store. The goal of your app project is learning, not creating something novel, and unique ideas don’t matter anyway.

Once you’ve picked an app project to work on, it’s time to move on to…

Related: The 2-Day Weekend Project Plan: Make Your Ideas Thrive

How To Take Your First App Project From Start To Finish: https://learnappmaking.com/app-project-learning-to-code/Click To Tweet

“Design” Your App Project’s Features

The next step is “designing” your app project’s features. This can be as simple as scribbling down a few notes on a piece of paper, or creating a full-blown app mockup and graphic design.

It’s easiest to just answer the following questions:

  • If you could only pick one thing the app should do, what would that be?
  • What does this feature look like? What goes “in” and what comes “out”?
  • Can you simplify this feature, to make it easier to build?

Again, simplicity is key, although you often arrive at simplicity after a lot of complexity…

Let’s say you are going to build that to-do list app from the previous step. What features should the app have?

  • Create and edit to-do’s
  • Show all to-do’s in a list on screen
  • Check to-do’s as completed

That’s it! Don’t overcomplicate your app by adding more features – this is enough.

Based on the list of features you can define the User Interface (UI) screens that should go into your app.

A few ideas:

  • One UI for showing all to-do’s, as a table view (UITableView)
  • One UI for creating and editing to-do’s, with a view controller with just one input field (UIViewController, UITextField)
  • An action for completing to-do’s, with a image view or button in the table view cell (UIImageView, UIButton, UITableViewCell)

At this point it helps to connect features with concepts you already know, as you can see above. To show all to-do’s in a list, you need a table view, of class UITableView, and you need to know how to work with it.

This is where what you’ve learned before will pay off. It’s also the point where you will first start to apply what you’ve learned.

Quick tip: did you complete a code guide or tutorial with a table view, or anything else you need? Find it, look it over, because what you learned in the guide might come in handy.

So, before you continue, to reiterate:

  1. Make a short list of the features of your app project.
  2. Figure out what UI screens your app should have, and what kind of tools, development concepts and Swift classes you can use.
  3. Check in with what you’ve learned before. Glance over classes you’ve used, and features you’ve completed before, and see what you can reuse.

Then, next up, is your app’s data structure…

Grab My Free iOS Development Course

Get complementary access to my course, Zero to App Store, and learn how you can build a real-time chat app with Firebase and Swift!

Yes, Send Me The Free Course!

Work Out Your App Project’s Data Structure

Almost every app stores data of some kind, either offline or online in an app back-end. In this phase of your app project, you’re going to take a look at the data structure of your app.

A game app might need to save highscores. A to-do list app needs to store to-do items on the disk. A chat app needs to cache the latest messages in the app’s memory.

The kind of data storage you need depends on your app project. Ideally, you keep it as simple as possible.

A few examples of data storage:

  • Saving Swift objects to disk with NSKeyedArchiver
  • Storing configuration values with NSUserDefaults
  • Creating an offline database with Realm or Core Data
  • Storing objects in the cloud with Parse Server or Firebase

It’s easiest to work with NSKeyedArchiver, which essentially “dumps” your Swift objects into a file that’s stored on the iPhone disk. You can hardly call this a database, because it’s just a flat file that you can only read from and write to. You can’t select or “query” any data from it.

The User Defaults, with NSUserDefaults, aren’t really a database, but a “key-value store”. You can store dictionary values in them, a value that’s associated with a key. It’s not uncommon to store simple data the User Defaults, but it’s capacity and performance is limited.

Core Data and Realm are both on-disk database frameworks, so you can use them to store relational data in your iPhone app. Core Data is developed by Apple, so it’s a “stock” library, and Realm is a popular third-party database framework. Quick tip: use Realm, and don’t look back – the trouble you will encounter with Core Data isn’t worth it.

Parse Server, Firebase and many similar tools and services allow you to read from and write to a database in the cloud. When you save data in your app, it gets sent to a cloud-based database. This is ideal for multi-user apps, syncing between apps, and much more. It’s also the most challenging to work with, especially if you have never worked with a database or a cloud back-end before.

The needs you have for a database are defined by how your app works. It’s a good idea to take a look at your app’s features, its UI and its mockups to get a feeling for what kind of database you might need.

Once you’ve made a choice, figure out the data models of your app. Which kinds of structured data do you need to save, and what are the properties of those objects?

An example, for the to-do list app:

  • You only need to save one type of object: a Todo object
  • If you use cloud syncing, you might need a User objects, so any user can log in and see their specific to-do’s

A Todo object has the following properties:

  • The text of the to-do item
  • A createdAt date-time that specifies when the object was created
  • A completionDate date-time that specifies when the to-do was completed
  • Optionally, a user field that specifies which user this to-do belongs to

Typically, you can tick a to-do item and mark it as “completed”. This will assign a date objec to the completionDate property. When you want to check whether a to-do item is completed, for instance to draw that to-do item as checked, you inspect the completionDate property. If it’s empty, the to-do is still pending, and if it has a date-time value, you know that the to-do has been completed (and when).

What kind of query do you need to get the right to-do items?

  1. Select all Todo objects
  2. Where user is equal to the currently logged in user
  3. Order by createdAt, in descending order, so the most recently created to-do shows on top of the list

You could also filter by “completed / not completed”. Then, a structured to-do item you get back from the query could look like this, as JSON:

{
    text: "Do my laundry",
    createdAt: "01-04-2017 11:51:33+0000",
    completionDate: null, // not completed!
    user: <User Object>
}

Once you start “thinking in data”, it’s easy to figure out what the data models, properties and database system is you’re going to use.

What’s next?

Note: My course iOS development course, Zero to App Store, shows you how you can work with cloud-based back-end tools like Parse Server and Firebase. If you want to learn how to code, check it out! » Learn more

Investigate Frameworks, Tools and Libraries

Frameworks, libraries and open source code! Don’t reinvent the wheel by programming everything in your app project yourself – save time by working with open-source code, and tools that make your life easier.

Every time you start a new app project, ask yourself a simple question: what third-party tools and libraries can I use?

A few examples:

Some tools aren’t even third-party, but are provided by Apple:

  • Auto Layout to make designing your responsive app easier
  • NSCache to cache objects in memory more sensibly than just an Array or Dictionary
  • SiriKit, or any of the other Cocoa Touch frameworks

There’s so much code out there! Chances are a library already has what you’re trying to build. You can implement the library, change some of its properties, and even copy its code and change it yourself.

Xcode integrates with several package managers to make working with third-party libraries easier. These tools can automatically update libraries, and add them to your project. Normally this is a manual process, so it’s recommended you use one of the automatic methods.

It’s also a good idea to think about what you want to achieve with your project.

  • Do you just want to build a simple app? Then don’t use any of the specific libraries, but focus on building the app with the basic tools first.
  • Do you want to learn how to use a cloud-based back-end? Then focus on that first.
  • Do you want to play with a library you found? Then focus on that.

Don’t focus on everything at once, and don’t load up your app project with too many libraries. Perfection often lies in taking away, not adding more.

And then it’s finally time for…

Set Up Your App Project & Build The First Feature

Now that you’ve prepared your project, you can finally set up your app project and start working on the first feature.

A few things to keep in mind…

First, make sure you keep your workspace tidy. A clear workspace is a clear mind, and and a clear mind learns and performs better than a chaotic one. This means your physical workspace as well as your digital one.

Think about:

  • Make sure to save libraries, project assets in consistently named folders.
  • Keep your code clean: remove code you’re not using, and use indentation to make your code bette readable
  • Cleanly remove libraries or code you’re not using, to avoid saving “remnants”. If you for instance want to remove a library from CocoaPods, don’t just delete it, but remove it from the Podfile and build it again

Second, build every feature one by one. Don’t build everything at once! Make a list of sub-projects to complete:

  • Configure the project
  • Create the data model classes
  • Make the first view controller
  • Load up all the to-do items
  • Customize the query that loads the to-do’s
  • Create the edit UI

Do not continue with a next project until you’ve finished the first. If you get into the habit of not finishing what you’ve built, for instance because you’ve ran into a challenging code problem, you’ll reinforce that behavior in your mind. How you do anything is how you do everything.

Third, set constraints for yourself and the features you’re building. It’s incredibly tempting to take a deep dive into an exciting Swift feature, but try not to get carried away too much. The goal here is to create a structured project, not to pick up everything that looks shiny.

Set a limit for yourself. Copy your project, try out the cool feature you found for a couple of hours, and then get back to your main project. Discovering new tools and concepts is extremely important for learning how to code, and getting better at it, but if it’s the only thing you do, then nothing is ever going to stick.

Fourth, try to base what you do on what you know. This is perhaps the hardest thing about learning: how do you know if you’re doing it the right way? When it comes to programming, there are so many right ways to do something, and so many wrong ways. Learning how to code is as much about knowing which way is right, as it is about having the skill to know how to do that.

Knowing what’s the right way often comes down to repeating something you know. When you’re starting to think you’re doing it the wrong way, take a step back and find a resource that explains you how to do it the right way. This can be a coding guide, a tutorial, or a friend who shows you how. Don’t go deeper and deeper until you can’t get out of the hole anymore, and give up. When you’re stuck, take a step back, and look for definite proof on how to move forward before you continue.

Then, once you’re well on your way, what’s next?

How To Ask For Help

At least 60% of coding an app project is solving problems. This is part of learning, and even the most adept coders still learn every day.

It’s inevitable that you get stuck with a coding problem or a bug at some point. If that happens, how do you ask for help?

First, you have to understand that the best developers know how to solve problems on their own. You cannot rely on outside help forever. Your coding skill grows as you learn how to solve bugs on your own.

You can categorize bugs as follows:

  1. Bugs that have a clear error message
  2. Bugs that have an error message, but it’s unclear
  3. Bugs that don’t have an error message at all

Solving the first kind of bug is pretty obvious: you read the error message, and then you solve it. An example would be the Index out of bounds error. This happens when you, for instance, try to read entry 99 in an array that’s only 3 entries in size. That doesn’t work – so you find the bug, and solve it.

The second kind of bug is harder, and it’s the most common in iOS app development with Xcode: a cryptic, unclear error message. An example would be the Unrecognized selector message you get in Xcode, when you try to build your project. Another one is the SIGABRT error that comes out of the blue, when your app crashes. What do they mean?

Ultimately, you get more experiences with these errors. A SIGABRT sometimes comes from an “unhandled” exception, that you can backtrace with the “Catch all exceptions” feature in the Xcode debugger. The message Unrecognized selector simply means that Xcode doesn’t know the property or method you’re trying to use. It can’t tell you how to solve that, because Xcode literally doesn’t know how…

The third kind of error is the hardest, because it doesn’t have an error message. Where do you start looking? First, if your app crashes, see if you can find an error message. Track exceptions in your app, or step through your code line by line.

You can also end up with a bug without error message if your app doesn’t behave the way you expect. You thought you saved the to-do item, but the next time you load the item, it still appears unchanged! This isn’t as much of an error, it’s simply a bug: the item isn’t saved. Backtrack your code, and pay close attention to what it does. A computer never does something out of the blue, on it’s own, or by magic – you coded it this way.

Then, what do you do when you’ve tried everything yourself already?

  1. First, make sure you have a clear understanding of the problem. Make it as small and as simple as possible, so “I don’t know how to connect to the database” isn’t a problem, it’s a feature, and it’s too big. This is better: “I tried to connect to the database, but it says Error Message“.
  2. Second, simply Google the error message, optionally add “ios swift” or “ios xcode” in your search query to help Google. Often, the solution is within the first few results on the page. Read the solutions you’ve found, and try them out. Does it solve your problem?
  3. Finally, if you can’t find it, ask a question on StackOverflow, Quora or Reddit. Clearly define the problems, the steps to reproduce it, the relevant code (not all of it!) and what you tried to solve it.

Be mindful of that last point. You won’t get help with a coding problem that’s vague, that you haven’t tried to solve yourself, and that’s hard to reproduce.

Important: Perhaps the best bit of advice is: don’t be lazy. When you’re writing your question on StackOverflow, you’re often stuck, frustrated, and you’re low on creative problem-solving energy. Take a step back, get a coffee, go for a walk, and either face your coding problem fresh, or ask for help when you’ve freshened up.

The more clearly you describe your problem, and the clearer it is that you’ve tried to solve it yourself, the more willing other developers are to help you. It’s their time they’re spending on solving your problem, don’t forget to treat it respectfully.

You’re almost finished now, so what’s left in your project?

Backtrack, Keep Going and Don’t Stop

Don’t leave every app project uncompleted. This is heart advice, please commit it to memory!

Don’t leave every app project uncompleted. Like you read in a previous paragraph, leaving a project or feature incomplete will reinforce the habit of not finishing what you’ve started. Sure, abandon a project if it’s completely lost, but don’t do that for every project.

See if you can finish your app project as close to 100% completion as you can, and ideally, more than 100%:

  • Bad: 50% is a half finished project
  • Better: 70% is a half finished project of which you’ve re-done 20%
  • Good: 100% is a fully completed project
  • Best: 130% is a fully completed project of which you’ve re-done 30%

Why redo a project? Once you’ve finished a project, during the project you often run into aspects you’d do differently next time. Make sure there’s a next time!

Say you’re working on your data model for the to-do list app. First, you create a boolean property that determines whether a to-do is completed or not. You complete the project, but while you do that, you figure that it’s more effective to save the completed / uncompleted state and the completion date-time in one step, instead of two.

You’ve finished the app project now, but then you backtrack: instead of using two properties for completion status and date-time, you go back and replace all occurrences with just one property.

This is backtracking, and it’ll greatly improve your skill as a programmer. It’s often much smarter to choose the best of two options, instead of choosing the only option you know. As a beginner programmer you want to increase the number of options you have for solving a problem, and one way to do that is to literally solve a problem twice, in different ways!

Related: 5 Skills That Boost Every Career If You Learn Programming

Conclusion

Thanks for reading this far! Hopefully you’ve now completed your app project more than once, and learned a great deal in the process.

Don’t forget that you’ve moved way past your initial end goal, which is to go from learning how to code to completing your first project.

During the project you learned a lot more about programming, solving problems, picking the right tools for the job, and redoing parts of your project using better methods. Awesome!

Did you enjoy this article? Please share!

How To Take Your First App Project From Start To Finish: https://learnappmaking.com/app-project-learning-to-code/Click To Tweet

Written By: Reinder de Vries

Reinder de Vries is an indie app developer who teaches aspiring app developers and marketers how to build their own apps at LearnAppMaking.com. Since 2009 he has developed over 50 apps for iOS, Android and the web, and his code is used by millions of users all over the globe. When Reinder isn't building apps, he enjoys strong espresso and traveling.

Grab My Free iOS Development Course

Get complementary access to my course, Zero to App Store, and learn how you can build a real-time chat app with Firebase and Swift!

Yes, Send Me The Free Course!

Comments & Thoughts