CS193p

Working On My Own App

If you’ve been following this blog at all, you know that I’ve been following along with the CS193p Stanford iOS course. If you haven’t been following this blog at all, you are in the vast, vast majority. Anyways, the latest assignment I’ve been working on in that class involves downloading a list of locations from the popular photo-sharing website Flickr and displaying them in a UITableView, which segues to actual images when a cell is selected. The assignment focuses on storyboarding your app and making smart choices with subclassing view controllers.

Image

I know what you’re thinking: Wow, Anson. That looks beautiful and organized, you are really an outstanding individualHow can I be more like you on a daily basis?

With this sort of game-changing organization, I was feeling pretty good about this assignment. In fact, I even drew out a diagram of what I wanted the app to look like and what subclasses I needed to make.

Well, I’ll make this story short. I wrote some very nice code to download the photos that was working perfectly, and then the very next day, it broke with no changes on my part.

ImageSeriously?

After LOTS of Googling, I found out that nothing on my end was at fault. It seems that as of right now, Flickr’s API (the tools that developers use to access the site) seems to be down/undergoing changes.

So basically, I can’t do the assignment.

Which actually turned out to be a blessing, because it helped me realize that I enjoy working on code that I actually want to write a lot more than “assigned” code.

I’ve had an idea for a simple game involving balls bouncing back and forth that I’d like to develop for quite some time now. I won’t delve into details, because I know that there are a lot of higher-ups at really successful start-ups and popular people that read this blog, and I don’t want them stealing my idea. Just know that the app will no doubt be a smash hit within hours of going live. And by “hours” I mean maybe weeks. And by “smash hit” I mean someone besides my mother will download it.

This week, I’ve been mostly working on the UI (that means “user interface” for the tech-illiterate) of the app. I’m going for a pretty basic vibe, with a few colors and some simple buttons and with a playing area in the middle of the screen. Here’s what it looked like in the beginning stages:

ImageLook at that beautifully-centered gray square and those perfectly-distributed buttons at the bottom.

By the way, I also drew out the way I want this app to look in my sketchbook. It makes me feel less like a novice app-developer and more like someone with actual vision. Or Michelangelo. The layout is really simple, so it only took about 30 minutes. There’s more to the final app than just this single frame, but it’s a good start for now, since this is where most of the action will be happening.

One of the things I want to make sure my app exhibits is at least a little bit of polish. I want the app to feel as though it took more than an hour to put together. One of the ways I’m trying to do this is by implementing some cool animations during gameplay. For example, when a user places a ball in the game, it will either be green or blue, and these colors always alternate. Instead of just making the user guess what color comes next, I decided to implement some bars at the top and bottom of the screen to indicate what color was up next. Not only this, but I want the bars to slide in and out when a ball is placed. Doing this required the use of several classes, with UIDynamicItem, UISnapBehavior, UIView, and UIDynamicAnimator being at the top of the list. After toying around with things like the “resistance” property of UIDynamicItem and the snapToPoint method of UISnapBehavior, I managed to get a pretty smooth-looking slide for my bars when something happens (for now, it’s me clicking the screen):

ImageAnson, that GIF is so smooth.

I promise that the actual animation is smoother than the above makes it seem. Anyways, it’s really cool to see my own project coming together so quickly. This is the first time in my life that I really feel like I have something that I really want to do, that I want to see all the way through no matter what. This app is quickly becoming my baby, and I’ve found recently that it occupies a large portion of my daily thoughts. I think about it in the shower. I think about it in class. That’s what people do with their babies, right? 

I’m not saying that this will be an easy journey, by any stretch. I’ve already struggled quite a bit with things I haven’t used a lot like delegates and protocols, and I haven’t even begun to write the code that will actually power the game. But I think that with a lot of caffeine and even more willpower, I can make this dream a reality and get this bad boy into the App Store before too long. And that, my friends, is a pretty cool thing to me.