Day 16–22 of #100DaysOfSwift with Hacking with Swift

Guess the Flag iOS game in Xcode simulator on MacBook Pro


Xcode 12.5.1 options to create a new UIKit project

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.

Photo by Joshua Fuller on Unsplash

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.

Project 3

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.

Example Xcode crash message when trying to access privacy sensitive data without user permission

Writing data to the Photos library on a user device isn’t allowed in iOS unless the user grants permission first.

My Storm Viewer app requesting access to device Photos library.

Wrap Up

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)!

Extra Credit

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.

Energy Consultant, Professional Dressmaker and aspiring iOS Developer