Independent Learning : Learning Swift

Independent Learning : Learning Swift


Learning Swift by Lenny Martinez

For my final project, I was putting together the pieces of what I've been learning this semester under Renée Stevens while she works on her first augmented reality app, tagAR. tagAR is being built for iOS currently, so it's built on Swift. I'll share a little bit about my experience learning to code in Swift.

But first, what's Swift? Swift is a programming language developed and maintained by Apple. It's used to build apps for Apple's iOS, macOS, watchOS, and tvOS. So, if you're really interested in developing apps for Apple environments, I suggest you learn Swift (the alternative being that you learn Objective-C, which is useful too, but different; check out this video for an explanation of the differences between the two languages). You can read more about Swift on Wikipedia or on the Swift.org website.

Before this semester, I had never touched Swift or worked in Xcode. Coming into this from undergrad, I was most familiar with MATLAB and Python, and after that I knew how to work with Java, JavaScript, and PHP from what I had learned in high school. I wasn't exactly a novice, but I also wasn't high skilled in thinking like a computer scientist. Early on, Renée Stevens, who I was apprenticing with this semester, shared some useful resources for learning Swift and designing for Augmented Reality:
- App Development with Swift iBook
- Apple Developer's Human Interface Guidelines for Augmented Reality

The book was very useful for understanding the basics of Swift, how Xcode is set up, and how to work using a model-view-controller (MVC) architectural pattern to organizing your apps (more on this last part here). Understanding and implementing the MVC was probably the most confusing thing while starting to work with Swift.

Reading the Human Interface Guidelines for Augmented Reality (and then skimming other sections for fun) wasn't directly useful for learning Swift, but it was useful to learn what the expectations were for an iOS app and then trying to meet those expectations affected how I programmed.

When it came to working though, a lot of the learning was done by consulting Stack Overflow, Youtube videos, and meeting with Renée (or sending code-snippets back and forth).

Stack Overflow
Stack Overflow is an online repository of questions (and answers) about all things coding. Users will post their questions along with the code they're working on and members of the community will answer the questions, and in the process correct the code that was originally shared. This open source approach was very useful because I could find answers to specific errors, and also get ideas for how to implement my ideas. The only drawback is that if you don't know what exactly it is you're looking for, you will likely not find the answer you need. A lot of the time, I had to rethink my queries and reevaluate what exactly I was doing to find information. This was helpful in trying to better parse what my actions were and to build code slowly.

Youtube Videos
Although Lynda has a course on Swift, and there are plenty of other ways to learn Swift, I found Youtube tutorials to be really useful because the person behind the code would explain why they wrote the lines as they wrote them. For example, this tutorial about how to get directions with MapKit and Swift 3 was very useful in 1) learning how to use MapKit, and 2) learning what part of MapKit I really needed for my AR wayfinding experience. Using videos like this, along with Stack Overflow, I was able to pick the pieces that I needed for developing my own feature.

Consulting Renée:
While I was working on the wayfinding feature and learning about Swift in general, Renée was working on writing the other parts of tagAR and that meant that the code kept changing. This could have been really stressful, but being able to meet with her removed all the possible stress. By seeing how she worked and asking her questions about the code, I learned what had and hadn't worked for her, and how I should work to make sure my code would fit within her code at the end of the development process.

If I had to go back, I'd probably do this course on Lynda.com to get the essentials of Swift in addition to working with the book. But aside from that I'd take the same approach to learning any other language: pick a project, read the basics, and then work to either write code or find code that's similar and can be adapted to fit your needs.

No related post

COMMENTS

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.