Theoretical Swift Master

I write our Gus apps primarily in C++ sprinkled with a little bit of Objective-C code.

My first app, which I still update, is written entirely in Objective-C.

This means I have not had a need nor desire to learn Swift. I simply did not understand people’s fascination with the language.

Ok, that is not entirely true. I do have one unreleased keyboard extension app written entirely in Swift. But honestly, it’s a bit of a hack job. Not only was it largely written in an Objective-C frame of mind but I also did not understand most of what the compiler was telling me I needed.

However, I thought it made me a Swift expert.

Earlier this year, I discovered it did not.


Have I ever mentioned I listen to a lot of podcasts? In an episode of Core Intuition, Daniel Jalkut said he was reading the The Swift Programming Language little by little. He had added a repeating task in OmniFocus to keep him on track and encourage him to get through it. Daniel said that the book was teaching him the nuances of Swift and it really got him interested in what he could do with the language.

But, frankly, reading a programming manual sounded boring to me. So I did nothing.

A couple of months later I was listening to an episode of SharedInstance. In it, the guys recommended the Protocol-Oriented Programming in Swift video (also known as the Crusty video) from WWDC[1].

To be honest, I had not watched any WWDC videos from 2015[2]. However, if there were one video I had heard about, it was this one. It just kept coming up.

Ok, I was curious. Time to check out what this was all about.

Step 1: Watch the Crusty video

Using my daily hour allocated to learning something new, I watched the Crusty video.

This made me realize I knew nothing about Swift. On top of that, the message was so powerful, it got me really interested in actually learning about the language.

Soooo….

Step 2: Read the manual

I decided to follow Daniel’s example and read The Swift Programming Language, despite assuming it would be really boring.

Boy was I surprised. The manual is very well written. I mean extremely well written. Hats off to the Apple engineers and technical writers that put it together.

#DanielWasRight

Often when I read books on programming or follow online tutorials, I’m left with some questions.

What would happen if I changed this…?

Does this need to go here…?

Why does this need to be in there…?

I then write a test program or app to try to answer my questions.

Inevitably, while reading The Swift Programming Language, questions would pop into my head. The nice thing about programming in Swift is the availability of playgrounds to quickly test an idea. I would then start a Swift playground to try them out.

However, as if the authors anticipated my train of thought, within a few pages the book would actually answer the very question I had! I learned I needed to be a little more patient with firing up a Swift playground.

Step 3: Read blogs and newsletters

Just like when you get to the end of a really good work of fiction, after finishing The Swift Programming Language, I wanted more. I started reading blog posts that would pop up in my Twitter feed. I googled for even more articles on Swift. I subscribed to several iOS related newsletters.

I could not get enough.

Result: Theoretical Swift-ist, Ph.D.

I now had a ton of theoretical knowledge, but very little practical experience. I needed a pet project to test out and refine my Swift knowledge.

Since the graphics for Gus on the Go are 100% vector based[3], I decided to write an SVG reader. A benefit of choosing this project was I could use the subject matter in the Crusty video as a starting point.

My Swift learning adventure is currently at this phase.

I’m writing my SVG reader using my one hour of learning per day. This is nice because it breaks up the monotony of constantly working on Gus. Additionally, when I get stuck on a problem in my Gus code base, taking a break from it to work on the SVG reader tends to give me a new perspective. When I get back to Gus, usually, I figure out the issue quickly[4].

I may, after getting the SVG reader completely working, implement an SVG drawing app. Who knows. It sounds like fun.


I am truly excited about learning more and trying new things in Swift. Something I never imagined I would say a little over a month ago. I haven’t been this excited about learning a new language since I learned Python.

Thanks for reading. Feel free to ping me on Twitter. I’m @yonomitt. I try to post regularly on random topics of interest to me.

Have a nice day,
Yono


  1. They also spoiled the twist. Thanks Sam!  ↩

  2. Again, because Gus is mostly using C++. And time.  ↩

  3. Arguably one of the smartest decisions we made early on.  ↩

  4. This also happens when I sleep.  ↩