Yes, Apps! Plural!! Over the last seven days I got to build two iOS apps (with the 100DaysOfSwift course by Paul Hudson of Hacking with Swift), one of which is a game! I think that’s impressive. Sure, it was guided and there is a lot of hand holding but I must admit, writing code myself, going through the challenges and trying to figure things out is definitely a great way to learn and remember. So let’s get right to it then!
I initially had quite a bit of trouble getting started because the default options in my version of Xcode(12.5.1) didn’t give me the same initial set up and files like in the video tutorial. A few google searches and I found the solutions I needed. It is also helpful to note that although the menu icons in Xcode might look different from the video tutorial and may have relocated; hovering over any icon will pop up some description text to help you find whatever you are looking for.
Project 1 — Storm Viewer
This single page app had a basic functionality of creating a file manager and allows you view each file on a separate page. In this case the files were photos of storms. So, it’s an app that lets you browse images! If you’ve been following the series, concepts that are used include arrays, variables, classes and methods. You are also introduced to a number of Swift’s built in types in UIKit along with more of the Xcode UI such as Storyboard, NavigationController, UIImageView, UIImage, ViewController, Auto Layout, Outlets, Interface builder etc.
Project 2 — Guess the Flag
For this app, we return to the single page app and build a flag guessing game. This time you build on things you learned and used in Storm Viewer and also learn new things like Asset catalogs, UIButton, CALayer, alerts and more.
This is a technique project which means a deep dive into one iOS technology. Technique projects will be recurring through the rest of the course so this is the first of many. This project builds on the Storm Viewer app and shows us how to let users share their photos with others via messages, social media etc. Here, we learn about the UIActivityViewController, UIBarButtonItem and more.
We also learn a little bit about things that can make the app crash such as missing privacy and permission code when trying to access user data. For example if you would like your app to write data (an image in this case) to the Photos library on their device.
Writing data to the Photos library on a user device isn’t allowed in iOS unless the user grants permission first.
If you have an iPhone you must have seen something that looks like the pop up window in the image above when apps request access to your photos library.
At the all three projects, there are challenges to complete for adding functionality to your app. I highly recommend doing these as they help you get even more familiar with Swift and Xcode. There is no solution to the challenges because the goal is really to get you thinking, solving and writing code. All the challenge solutions that I created are included in my code on GitHub here: Project1, Project2 , but if you are working through the course, try solving the challenges on your own first before checking them out. Feel free to get creative with the challenges when you work through them. You can also let me know ways that I can improve if you’ve found a better or simpler solution than what I have created.
Congratulations, you are an iOS app developer (sort of)!
As a fun extra credit step, I decided to share my code on GitHub for two reasons. First to get familiar and comfortable with git/version control and second, to begin building a portfolio of my work. I used the GitHub Desktop app which does a lot of the heavy lifting and you can avoid the command line entirely. However, it is recommended to know how to write git commands in the terminal. It’s also always helpful to have a cheatsheet for git commands handy. Here’s one from Github education : git-cheat-sheet.
I am definitely looking forward to getting more comfortable with Swift as I continue the course. Also, I'm 1/5th of the way through #100DaysOfSwift!!
Go back to 100 Days of Swift Pt 3.