This post was originally published on my old blog, El Imperdible.
If you were one of those people who didn’t miss an article from El Imperdible, you surely noticed that this blog has been in a coma for a few months. I could make excuses, like there has been a global pandemic, but the truth is that I’ve found a new hobby: creating apps.
Do you know that list of things you would like to do before you die but never find the time or put enough effort into doing? Well, learn to code had been on my list for so long that the rest of the items were treating it with formal respect. Every year, when the WWDC (Apple’s developer conference) arrived, I’d dust off the list and say that this year, for real, I would get to it. Then I would keep postponing it because it either wasn’t the right moment, I was too busy, or [INSERT YOUR EXCUSE HERE]. And so it went on and on until last November, when a Black Friday deal ended this sort of Groundhog Day.
How I learn to code
Learn to code iPhone apps is like learning a new language. It’s not easy, but with desire, effort, and persistence, anyone can do it. That said, it’s key to know where to start so as not to feel completely lost.
If you search on Google, you will surely find thousands of pages, courses, and videos that teach programming from scratch. Some are good and others not so much, but when you start, it’s not easy to differentiate them. So here’s a list of resources that have helped me learn to code, from I have no idea to well, I know how to manage a bit:
- Shortcuts. It’s an app that comes installed by default on all iPhones and iPads. It allows you to create small “apps” without writing a single line of code. You just drag and drop blocks. It’s a good way to learn the basics. You can create something simple to really complex stuff.
- Swift Playgrounds courses (iPad, Mac). It might seem that it’s just for kids, but it’s the best way to take your first steps in Swift. It teaches you the basics from scratch and is very enjoyable.
- “iOS 13 & Swift 5 – The Complete iOS App Development Bootcamp” by Angela Yu. It’s the famous course I bought on Black Friday for €10. For that price, I didn’t know what to expect, but it turned out to be a hit. You learn by making apps, starting from the simplest and gradually increasing in difficulty. The only downside is that SwiftUI (which is simpler and faster than UIKit) is barely touched in one module. It has several very important Pros when you start: It teaches you to use Xcode, all kinds of programming concepts and, above all, to fend for yourself.
- Apple’s SwiftUI tutorials. It may still be in its infancy (we’ll see at WWDC), but SwiftUI is the future. Plus, it’s much more accessible for beginners than UIKit.
- “100 days of Swift” and “100 days of SwiftUI”. Once you start to go solo, at Hacking With Swift you can find tutorials to do practically anything.
- Google and Stack Overflow. For when something goes wrong and you don’t know why.
If you’ve been opening the links, you’ll have realized that most resources for learning to program are in English. Although there are websites like Apple Coding that have a lot of information and tutorials in Spanish, English is very helpful. Especially when you’re stuck on something very specific and don’t quite know where to continue.
And now, the million-dollar question. How many hours have you spent learning to program? According to Toggl, about 100 hours (between courses and tutorials). Although, to be fair, another 150 hours that I’ve been developing several apps on my own should also be added.
I won’t deny it, the lockdown has been very helpful in learning to program. That said, what’s really important is the commitment. Just like with the gym, you start to notice the results when you’ve been working for several weeks and months. It doesn’t matter if it’s an hour a day or Sunday mornings, the important thing is consistency.
SafeTimer, My Very First App
Besides continuing to learn, I took advantage of the lockdown to make and launch my first app: SafeTimer, an app we developed altruistically at Hortelanos that helps you control the usage time you’ve given to a mask.
The idea came up when we started looking for reusable masks. Most brands talked about X hours of use before they needed to be washed or have their filter changed. The problem was that, unless you used it for work, most of us use masks intermittently: 30 minutes when going out to shop, 10 when walking the dog, two hours when going for a walk… It’s easy to lose count and if you exceed the usage, the mask loses all its efficacy.
Since there was no simple way to control the use (and I was very into learning to program) I decided to take the plunge and create SafeTimer. Along the way, some friends like Miguel de Andrés, Patricia Bedoya, or Carla Auclair… joined, and thank goodness they did because I wouldn’t have made it without their help.
Four weeks later, here we are. The app can now be downloaded (totally free), all the code is published openly on GitHub, I’ve published the first update, and I have other improvements underway.
Four Things I’ve Learned
That said, here are some things I wish I had known before starting to make the app:
- Spend a couple of hours planning everything more or less. It’s easier to make changes on paper than on code, especially if it’s a foundation decision. The same with the design of the screens, make sketches on whatever (I use Linea Sketch) and try to tinker with it to see if it works before designing it in Xcode.
- Start testing as soon as possible. Try to get feedback from all types of users, this way you’ll discover use cases that hadn’t even crossed your mind. A friend discovered a very serious bug within the first 30 seconds of using the app that I hadn’t even considered.
- Make your app as flexible as possible. It’s easy to overlook at the beginning, but it has to adapt from a tiny screen like the iPhone SE’s to a giant one like the iPhone 11 Pro Max’s. The same goes for languages (texts don’t have the same length) and accessibility. If you start with this from the beginning, you’ll avoid many headaches at the end.
- SwiftUI is the future. It has its limitations, but I wouldn’t have been able to make the app in such a short time without it. It’s so agile and simple that I was able to make the version for the Apple Watch (which is totally independent) in less than 10 hours of work. All thanks to all the code from the iPhone version that I could reuse.
What’s Next?
Well, to continue learning and creating apps.
I have many ideas in the pipeline, some more ambitious than others. Plus, WWDC is just around the corner, and I’m eager to see what’s new in the new versions of iOS/iPadOS/macOS/watchOS and, especially, SwiftUI.