Learn Courses My Dashboard

Andrew's Journey to Release an app

The Goal

Greetings! I am posting this journal as a way to keep myself accountable, and moving forward with development. So many times in my life, do I get excited about an idea only allow to allow it to fade as difficulties emerge to replace it with a new idea. I’m not allowing that to happen this time. Prior to 2021 closing, I am embarking yet again on a path towards coding an hour daily. Through this, I will keep building momentum to release my own app.

A Little History

In the summer of 2017, I gave my first shot at iOS development. Then, it was all about Storyboards/ UIKit. I found I could create apps as long as I followed along with the videos from the instructor. Once, I stopped, and tried my own project, I would get totally lost. That’s why Chris’s method of producing challenges for important concepts has been so valuable to me. It forces me to remember how to implement components on my own.

Only five years ago, I hated programming. I learned Java in college, where I got completely lost with Object Oriented Programming (OOP). I didn’t understand how anyone would voluntarily code for a living. However, my views changed a few years later as I discovered Python for work.

I was impressed by Python’s simple syntax and powerful libraries. Something that would have taken me days to produce in Java could be done in less than 10 lines with Python. Also, Python allowed me to create complex function-based programs. I was able to produce powerful programs without using OOP at all, only through functions. However, as these programs grew in complexity, and with guidance from some more senior developers at work, I began to see the value in OOP.

It is so much easier to maintain classes versus functions. You can extend classes, while leaving the older code alone. You can modify a simple file to fix a bug everywhere. Also, it’s nice to modify an object itself versus throwing around new variables everywhere, as I might do with functions.

In March 2020, I became proficient enough with programming to even begin to make my own web apps that do something no one had done before. I learned how to run the front-end with JavaScript, and a backend with Python’s Flask/ FastAPI frameworks along with databases like MongoDB and PostgreSQL. It took me about eight months to pull everything together, but not I understand full stack development with multiple technologies. I can build production-grade apps.

Planting the Seeds

However, for my latest project, I needed to run code on the user’s phone. I wanted my app to be able to work, even without connectivity. Plus, I liked the security and cost benefits associated with this. If my app scaled beyond my wildest dreams to thousands of users, I might be set with thousands of AWS bills. Rather, by doing the compute/ heavy lifting on the user’s iPhone, I would avoid all of that.

Plus, my app would perform faster, because it would not need to go to the server with its request, wait for the server to process it, then return a response. It could process everything itself.

My app needs to convert photographs of receipts into text. I was able to get something running through Google’s ML Kit (always ironic to me that Google produces some of the most relied-upon technologies for iOS developers, like Firebase). The app was able to perform Natural Language Processing (NLP) successfully, but could not get the order of the words right. It would confuse items in the receipt as one paragraph without saving their prices correctly. I attempted to debug it myself, but couldn’t. That’s when I decided to invest the time and money to learn iOS Development again.

Learning with Code with Chris

I started the 14-day challenge with Code with Chris in late July. I loved how everything was setup. Chris and the team did a brilliant job with the coursework. Plus, it’s fantastic how the courses are setup: foundations; performing; and professional. This spurred me to join CWC+.

For me, the plan is to complete the SwiftUI iOS Foundations, databases course (because I want to hold data locally), and design courses to improve design, followed by the machine learning course. Once I get through with these, I will feel confident that I can build my own app.

I worked on the iOS Foundations course from August until mid-November. It was discouraging at times. I thought to myself, if this is taking me so many months for a single course, and this is one out of ~18 courses offered by CWC+, how would I ever finish? Still, by sticking with things, pushing through, when I did not grasp everything, later with more time in the language, I started to understand more. I was so happy to complete the iOS Foundations courses. It truly teaches you what you need to build an app.

I knew that with the knowledge it taught me, I could start building my own app. However, I decided to hold off to learn more, to finish the databases, and am excited to learn more about design/ Figma.

The Present

Right now, the day after Christmas, I aim to code daily, ideally an hour every day. I’m about to start module 2 in the databases course (after taking my time in the module 1 challenge, where I implemented SwiftUI Firebase code to more efficiently parse objects between Swift and Firebase, more details here).

Any tips people can pass on about starting a business/ generating revenue from apps are much appreciated.

I hope by sharing this, I can connect with others, keep myself accountable, and build better apps. I was encouraged myself by @CalStark’s post, Two best friends starting a business - #7 by CalStark.

Cheers,
Andrew

3 Likes

Welcome Andrew!!

I loved reading your story! Everything seems impossible at a high level but when we break it down, it’s just a bunch of small steps :slight_smile:

I can’t wait to see the app you build!

You may find this playlist interesting!

Figure out how you want to generate revenue is it a paid app upfront, free with in app purchases, etc. figure out your monetization model

Also if you really want to start a business with this idea, I’m based in the USA, my suggestion is to start an LLC and make an Apple developer account specifically for that LLC. If you’re not based in the USA, I can’t really give any advice.

Best of luck! I can’t wait to see your app in the end!

2 Likes

Hey Mikaela, thanks for taking the time to read my post, as well as your encouraging words, and sharing that YouTube link!

That seems like a useful playlist indeed. I always procrastinate on things like this, but with this further information, I will at least learn up on the different strategies before starting, and choose one.

Thanks so much :slight_smile:

1 Like

Day 1 - Databases - Sunday, December 26, 2021

I eked out an hour of coding today. After having to re-install Xcode in order to fix a bug in the 13.2 version for Apple Silicon, I finished lessons 1 through 3 in module 2 of the databases course.

I was very grateful the team came up with a project that was able to migrate the JSON code into collections and documents in Firestore. Still, it seemed so tedious to do this, so I’m looking for more ways to do this, and might write my own in Python.

Day 2: Databases M2L4 - Monday, December 27, 2021

Unfortunately, did not get to code a full hour today, but grateful to code at all :slight_smile: I got in about 45 minutes, and 3/4 of the way through lesson 4 in the database module 2. In this lesson, Chris hammered down the point between classes and structs within Swift. It was a real, practical reminder of the very real differences between these data types.

When you pass in a class to a method, you pass in a reference to that class, so that the method can change the class above/ outside of the method. In contrast, with a struct, when passed into a method, you are dealing with a copy of the struct. So it’s like dealing with a constant. You can’t change the struct above the method/ outside of it. Instead, you need to find another way to reference the exact property you want to change through some clever looping.

Day 3: Databases M2 Finished Began M3 - Tuesday, December 28, 2021

Finished the module 2 lesson 4 in the Databases course, where you add a database to the learning app. I loved getting to use a completion handler/ adding that to our own methods. This makes it, so that we don’t need to race different code against each other. Rather, the UI code only launches once the documents from the database are fetched.

Module 3 - Lessons 1-2

I loved how fast Chris gets us up and running in this module! This practical knowledge helps people solve one of the most important, and often, tedious components to building any application. It’s great that we can use all of this pre-made code from Google to get started. Still, at the same time, it only locks me more into the Google/ Firebase ecosystem (ironic as we are often locked into the Apple ecosystem).

With this much buy-in/ lessons learned on the Firebase platform, it makes me not want to use any other platform, the cost is almost like starting over. Still, at the same time it is almost a challenge to me, because I want to use a different provider. I looked into other database providers for iOS, and they are scant/ far-between. No one else seems to support mobile developers as Google does in this matter. If anyone knows of another solution that gets us, so far off the ground, then please let me know. Otherwise, I might build my own connectors/ starter pack, if there are really no others. It’s times like these, when a call to Twitter can get many responses to this question. I’ll try that now…

Overall, happy to code a full hour today. It makes a huge difference to begin programming earlier in the day!

1 Like

If you’re looking for a cloud database you can pretty much use about anything.

You’d just need an API that can send and receive data to your database from the iOS app.

Some popular options:

  • Firebase
  • MongoDB and Realm
  • CoreData / CloudKit
  • Swift Vapor and PostgreSQL
  • AWS Amplify
1 Like

@mikaelacaron thanks for looking into some other providers, and this response!

That’s a great point: simply use the service’s provided API. It’s probably not as difficult as I thought without Firebase. Perhaps, there are some good ways to use interact with the database/ API, and try out the Combine framework as well (something I hope to see in part of CWC+). Thanks :slight_smile:

Day 4 - Dependency Issues - Wednesday, December 29, 2021

I spent most of my hour attempting to get FirebaseUI installed. I could not figure out how to use Xcode’s new Swift Package Manager to install this package. When I attempted to use the FirebaseUI GitHub repo link, it didn’t work. It gave me a warning about the packages not being installed correctly, then showed some of the other Firebase packages it could resolve (none being the correct one).

This led me to install the required packages using Cocoa Pods. However, that brought up its own set of errors/ requirements. I successfully installed Cocoa Pods with sudo gem install cocoapods. I successfully initialized pods/ a Podfile in my project’s root folder, and added the required packages to the Podfile. Although, pod install was not successful. That led me to check out an article about installing pods on Apple’s M1 Macs (my best Christmas present ever after using a seven-year old Mac for development, builds get built in less than 10 seconds).

Unfortunately, the first command, sudo arch -x86_64 gem install ffi, in the tutorial failed. This led me to attempt to resolve the error message please install libyaml and reinstall your ruby by installing home-brew. Adding brew to the path with echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile. After this, I successfully installed libyaml with brew install libyaml, re-installed ruby with brew install ruby, but haven’t been able to solve the underlying error still.

Day 5 - Pod Install Fails - Friday, December 31, 2021

After hours of searching, I still haven’t figured out how to install pods via an M1 Mac. I have tried many solutions, including those “working in December 2021,” but none work.

I just posted the issue here: M1 Pods Install Crash

Day6 - Happy new year! Bye-bye bugs - Saturday, January 1, 2021

After spending too many hours on pods failing to install on an M1 Mac, I’m very thankful to @Chris_Parker for engaging with me, and finding a solution. This website is great for people that get stuck! It’s like a smaller version of StackOverflow for those dedicated to iOS development.

Today, I learned how to implement Google’s pre-built UI for authentication. It’s so simple. They handle some important and tough facets for you, right out of the box.

1 Like

Day 7 - Custom Auth - Sunday, January 2, 2022

Today, I continued learning in the iOS Databases Module 3 lesson 3, where Chris teaches you how to implement a custom login versus using Google’s pre-built FirebaseUI Auth.

I’m alway impressed by how easily others seem to take to the UI design/ components of app building, while that’s one of the more difficult pieces for myself. So it’s great to go through these lessons that have you swap in and out different types of UI designs like this.

Day 8 - Sign up Screen - Monday, January 3, 2021

Today, I finished the Create Account screen within the iOS Databases Module 3 lesson 3. I barely eked out 50 minutes of coding, so aim to get a whole hour in tomorrow by starting earlier.

Day 9 - M3L2 → M4L3 - Tuesday, January 4, 2021

Happy to code for a full two hours today! It feels great to get in the groove again.

In addition, I added my own feature to the small Firebase Authentication demo app (iOS Databases Module 3 Lesson 4), so that, when a user logs into the app, it greets the user by name. It was great to access a single value within a single field of the document. It used a similar method to that in Python .get, which returns the value if the key/ value exists, or returns nil, if it does not. Here’s the code for it:

/*
 Get the first name of the user, if there is one
 */
func getFirstName() {
    // Ensure the user is logged in
    if let userId = Auth.auth().currentUser?.uid {
        // Get our document reference
        let docRef = Firestore.firestore().collection("users").document(userId)
        
        // Get the document here
        docRef.getDocument { snapshot, error in
            // If we have no errors, and the snapshot is not nil, then get our user's name
            if error == nil && snapshot != nil {
                DispatchQueue.main.async {
                    // Set the name to what is stored in the database
                    name = snapshot!.get("name") as? String 
                }
               
            }
            
        }
    }
    
}

At first, I tried doing all of this via a computed property, but instead used the .onAppear code in order to run this method as soon as the View appeared (still quicker than appears to the user). It was nice getting this written by myself! I find in Python, I can code nearly anything by myself. While in Swift, it is much more difficult.

1 Like

Day 11 - M4L4 5 - Thursday, January 6, 2022

Today, I finished the user metadata video in the iOS Databases Module 4 Lesson four and started lesson five. It was surprising to me that in order to track the user’s metadata, or user’s profile attributes, we used a helper class, versus properties of the ContentModel. It was cool seeing how to implement this class, so that only one exists in memory in the entire app by declaring a static attribute of the user, and making the class not able to be initialized outside of it.

class UserService {
    
    var user = User()
    
    // Use a static property of this this class in order to only have one exist in memory
    static var shared = UserService()
    
    // Stops this from being initialized anywhere else
    private init() {
        
    }
}

This is called a singleton!
It’s okay for some things, but overall many people avoid singletons because they are hard to test

Ah, thanks for that! A singleton good to know, another term in the arsenal. Interesting that it is difficult to test with.

Can’t wait to eventually get to the testing learning module in the performer courses :slight_smile:

1 Like

Day 12 - Database M4L5 - Tracking User States

Friday, January 7, 2021

I went through the database user tracking lesson today. I was so impressed by the ability to save the data to the database, right as the user makes the app go into the background. Apple gives us as developers a lot of control on this through their Publisher notifications (the app going to background notification is a Publisher notification). This made me want to ask this question about privacy.

In these few lines, on one of your views, you can execute some code as soon as the app enters the background state:

// Listens for Published events, like the user making the app go into the background, once this happens, we save to the database
.onReceive(NotificationCenter.default.publisher(
                     for:   UIApplication.willResignActiveNotification)
) { _ in
  // Save progress to the database, when app moves to the background
  model.saveData(writeToDatabase: true)
 }

Also, unfortunately, as part of this lesson, I confirmed that my app’s tests are not working properly! It does not show all of the questions/ allow the user to click any of them. I’m not sure the source of this, but my repo is here if anyone is feeling especially curious: GitHub - agholson/Learning-App-with-Firebase-Auth

Day 13 - Completed Databases Module 4 L6 - Resume View

Saturday, January 8, 2022

Happy to complete another module today! Although, much of the navigation within views still confuses me. I read in here that a few people struggled with backend/ database stuff, while I’m the opposite. I find the front-end UI stuff more confusing, especially as it comes to tracking tags/ selections in tab views and all of the different State properties that bounce you left and right.

Also, I’m confused, because my Learning App’s questions don’t work. I’m going to post about it for some more details.

Day 14 - Completed M5 L1-3 - Core Data

Was happy today to finally learn how to save data locally within an app! It is a bit complicated, but I love the way Chris breaks it down. Plus, because you can access the contextView needed to interact with Core Data anywhere in the app by passing it down via an environment variable it is simple to save data locally.

See here for a synopsis.

After this, I only need to learn how to create mockups and do some machine learning, then I should be ready to build a prototype of my app :slight_smile:

1 Like