I created this iOS app for a semester long software engineering project. Our assignment was to create a “useful program”, and follow fundamental software engineering principles. At the time, I had taken an interest in learning how to play a game called Magic the Gathering. For those unaware, Magic the Gathering (or MTG) is a card game in which two players duel against each other until one player reaches a health pool of zero or less.
To start, each player would need to create a deck 60 cards, each unique one providing different abilities. One of the biggest issues I had when learning how to play, is the fact that there are so many different cards (over 10,000)! Talk about a steep learning curve!
When I first began to play, I often had to reference online documentation for certain cards as their abilities (or limitations) may not be apparent from the one or two short sentences printed on the card. Additionally, the cards were collectable and had value. Part of playing the game socially includes trading cards. I usually had no idea if I was making a fair trade.
Enter my idea to make a MTG card recognizer. I wanted to make an app that did it all. That told me the rules of play and the market price. And I wanted to do all of this quick. After some brainstorming and research, I decided I wanted to use the iPhone camera to recognize a card quickly, and get relevant information straight away.
As part of my research, I found a free-to-use REST API on a MTG website, giving me exactly the information I needed. I also found a library that made it easy to add optical character recognition (OCR) to an iOS app. Having just won an hackathon contest a few months earlier, I was a definitely over-confident. Oh and I forgot to mention, I didn’t know Objective-C (the primary iOS programming language at the time), but I did know C. My thought: how different could they possibly be? Heh, I would soon find out!
At the start of the project we were tasked to clearly define the requirements of the project to be completed with the 2.5 months we had to work on it. I listed all of the features I wanted, without giving second thought as to whether I could get it all done in time: a Snapchat-like UX that allowed the user to side-swipe between the card identification camera mode, and another view which listed previously scanned cards. I was even ambitious enough to state that I was going to allow marking scanned cards as “owned”— that way a user wouldn’t have to dig through their collection or rely on memory.
In the end, I wasn’t able to complete all requirements. But I did learn a valuable lesson: estimating how long development will take is a skill that is learned and improved upon with experience.
My technical struggles were related to learning the Objective-C language, as well as trying to incorporate OOP and iOS principles. As an example, separation of concerns was something I’d never thought about before. I was no longer in a hackathon writing spaghetti code.
The Snapchat-like UX I listed as a requirement must have taken me two-three weeks. The OCR was not as straight forward as I thought. I needed to define rectangle coordinates within the photo that was taken so that the OCR processor knew were to look for text. Lastly, this was also not to long after Apple introduced a new screen size to devices (jumping from 3″ to 4.5” diagonally), and accounting for two different screen sizes was something I was not prepared for.
What I learned:
- MVC and OOP principles
- Basics of Objective-C
- Introduction UIKit framework
- Introduction to Core Graphics
- Importance of estimating the time it will take to complete a project