StretchApp 2

StretchApp 2

Four years ago, I returned from visiting family over Thanksgiving and I went on a fitness rampage. I dropped about 40 pounds in the span of 6 months (which I’ve kept it off since then) and I learned the hard way that stretching is important.

Fast forward to last year. I was taking an iOS development course with Bloc and I had to choose a capstone project to complete the course.

Capstone Project

Defining the project

I couldn’t find any Apps I liked for Stretching, so I sought to make one myself. The equipment I use to stretch at the gym includes the following:

Rather than lug booklets on how to do the stretches, referring to placards on equipment, tracking stretch times, tracking break times, when to switch sides, etc., I sought to create an app that automates stretch routines and gives the user visual and audio cues.

Programming

Core Data seemed like a great way to manage the stretch library. I assembled the stretches I wanted include in the app and threw them into a JSON file. I developed an object graph for the stretch library. Creating a scaleable object graph was one of the more challenging aspects of the project that I encountered, as I wanted to get the project out the door and leave room to grow it later.

I did the initial version of the app in Objective-C, but I recently rewrote it in Swift 2.x. I also refactored a lot of code to take advantage of new capabilities in Swift, like property observers and new iOS 9 functionality like UIStackViews. In the latest version, I also subclassed a lot of code that previously lived in the UIViewControllers.

Fun Stuff I Learned Along The Way

During my Bloc course, I learned about CocoaPods and integrated a couple for some Bloc assignments, but I never ventured far outside my “comfort zone” during the course. Upon completion of the Bloc course, I started exploring various third-party frameworks laying around on GitHub.

Chameleon has turned into one of my favorite frameworks. It’s a lightweight, but powerful color framework for iOS that obviates the need to monkey around with RGB values. It makes creating gradients and color schemes effortless.

Crashlytics is another one of my favorite frameworks for monitoring user experience. Fabric makes it a snap to install Crashlytics into any project. From there, it’s just a matter of providing Crasylytics with dSYMs for the project and it notifies you of any problems users might be experiencing.

UIStackView is my favorite new thing in iOS 9. When I refactored my Objective-C project to Swift, I redid every scene using UIStackView. It makes laying out scenes a much more pleasant experience.

Lastly, I ventured into banner ads via AdMob. I discovered with the initial version of StretchApp there are gym rats out there that’ll pay for it, but I’d rather get scale. Integrating AdMob into my project enabled me to throw it out there for free.