June 5, 2014

Apple has introduced Swift! It’s a whole new language. I’ve rewritten the TweetGettr iOS app for Swift and put it up on the Githubs for you. Check it out and I hop you find it educational. Requires Xcode 6.


Twitter Client Tutorial Update

May 10, 2014

Over a year ago I posted a tiny not-quite-tutorial on pulling down Twitter user timelines into a simple UITableView. Twitter has since changed the way their API works and you now need to be authenticated before you can use their API.

I’ve put together a new Xcode project that handles the authentication (assuming you have a Twitter developer account and have created an app), and does some other nice things. The project is up on the githubs and is a pretty good place to start if you’re interested in building iOS apps.

The project covers a lot of the main iOS programming techniques, namely:

  • Using Categories
  • Making URL Requests
  • Using UITableViews
  • Showing UIAlerts
  • Pushing UIViewControllers onto the navigation stack
  • UI niceties like keyboard management and activity indicators

If you’re interested in an Xcode project that’s not too complicated that you can play around with and learn more with, check it out!


I Did Not Like The Last Of Us

February 1, 2014

Let’s take a small break from programming topics so I can get something off my chest: I did not like “The Last of Us.”

And actually, considering how adored this game is my feelings trend toward hate. And being hateful all by my lonesome makes me even more hateful. It’s like a shame-spiral of hate.

I’d heard a lot about this game. Many claim it’s so good it’s worth buying a system for by itself. I don’t have a PS3 so I borrowed one and “The Last of Us” to give it a play-through. I didn’t know too much about the game except it was supposed to be a cinematic, post-apocalyptic zombie game with a deep, emotional, and sophisticated story-line. And I had not heard one negative thing about it.

OK, fine. I grab a beer and pop the game in. It starts off with 20 minutes of back and forth between cut-scene and controlling a 12 year old girl and her father. The character animation I can only describe as “creepy” in that uncanny valley way.

Point #1: the more you pile on the polygons and textures of your human characters, the more necessary it becomes to absolutely nail the realism otherwise it will just be off-putting.

The Last of Us doesn’t get it quite right and the results are emotionally jarring.

Point #2: the character controls are among the worst I’ve experienced. They feel mushy and the third-person over-the-shourlder camera feels really wonky.

Maybe it’s the decades of playing AAA platformers that has me spoiled for spot-on character controls, but I couldn’t help but feel like I was playing with a ball of mud.

So then we have the end of the intro where the character I’ve been playing gets killed. It’s supposed to be this emotionally compelling and affective moment but I thought it was repulsive for a couple of reasons. 1) the aforementioned creepy character animations were not helping at all. 2) The character I was playing is the one that gets killed. The game has me asking now what and why the fuck would a game start that way? 3) 20 minutes is not long enough for me to get emotionally invested in a player character no matter how good everything else is. 4) The “child getting killed” plot point is, at least for those of us with kids, a very powerful one and should not be used lightly. I feel like this game was being emotionally abusive and manipulative from the get-go.

Once the game actually starts, you’re in a post-apocalyptic future world 20 years after your character’s death only you’re now playing your character’s father. The first “freedom of choice” thing I try out is when one of the cops tells me to move along, I disobey and return. I eventually get hit by the cop so hard it kills me. The game restarts me 50 feet from the scene of my death.

Point #3: I can’t wrap my head around how this game treats death. It starts out with treating death with affective reverence (e.g.; the death of Sarah at the start of the game) immediately followed by treating it as basically inconsequential. Also, this game ostensibly provides the player with the ability to make moral choices but establishing early on that choices are inconsequential (e.g.; the choice to “kill myself” by egging on the cop) means the moral choice mechanic is basically meaningless.

Next, I’m controlling Joel and adventuring with Tess and it’s mostly just amazingly boring. BOOST UP HERE. MOVE PLANK HERE. I feel like I’m a machine that’s just there to press X and move from cutscene to cutscene.

When it’s not amazingly boring it’s disgustingly violent. The shooting and head snapping and punching is really gross and something I absolutely don’t want to get used to.

Point #4: THE CUTSCENES OMG THE CUTSCENES. As boring and mushy as the gameplay is the cutscenes are just painful to wade through.

So you’re supposed to smuggle a young girl across the country and that’s basically the game and in between you kill zombies or sneak past them or whatever, I can’t even tell you the details because at this point I’ve given up. I watch some play through videos on Youtube to see the parts I might have missed and realize I haven’t missed anything really and actually might have dodged a bullet or two. #1) I borrowed a PS3 and The Last of Us to play this when the internet was telling me to buy one. #2) I could have ended up wasting 20+ hours on this game when I only wasted a few.

No, this game is NOT deep or emotionally sophisticated. In fact, all the people talking about the story and the characters with such reverence make me wonder what kind of standards they are using to judge it. It’s a zombie story that does its best to be emotionally manipulative but for the most part is banal and brings nothing new to the table.

Point #6: Telling compelling stories in an interactive way is a monumentally difficult and complicated task.

I can’t think of anyone who has succeeded in this aside from The Stanley Parable. But The Stanley Parable kind of cheats because nonlinear/odd structure is built into the way the story is told.

So, yeah. The people loving on this game I do not understand at all. If it were more under the radar I would consider it just a “it’s boring/I didn’t like it” game and move on. Since there are essentially ZERO bad reviews on the internet my indifference has turned to hate. And hate has turned into this blog post.

Actually, there are not zero bad reviews, I should take that back. There are a few articles that kind of helped me think about this game. The first is this review from Quarter to Three. The author is critical of the gameplay aspects in an articulate way although he thinks the story is inspired and human which I obviously disagree with. Another review is this one from No High Scores. The author does a *really* good job of explaining why the game doesn’t live up to the hype.

My favorite article has to be this one by Terence Lee and while it doesn’t mention The Last of Us, it does mention the mechanics of interactive storytelling by comparing that with the mediums of books and film. It’s a very smart and inspired piece and I highly recommend it. I can’t help but think he was talking about The Last of Us without naming during the writing of his article. And I think a lot of why I think The Last of Us fails is explained by Terence’s piece on interactive storytelling.

So, to sum up: The Last of US is a mushy, emotionally manipulative, creepily animated, zombie stealth game that gives you heaps of meaningless choices and non interactive cutscenes. Oh, the non-character scenery and set pieces are GORGEOUS and the graphics are technically amazing. Too bad those are almost the last thing I look for in video games.

NSString Concatenation Using Categories and NSArray Literals.

August 23, 2013

A while back I had posted on concatenating NSString objects. Now that we have literal notation, let’s see how much easier and terse we can make this, hmmmm?

Here is the category on NSArray:

@interface NSArray (StringUtilities)
- (NSString *)string;
@implementation NSArray (StringUtilities)
- (NSString *)string;
    return [self componentsJoinedByString:@""];

Before, using my category on NSString would make concatenation work like this:

NSString *test = [NSString concatenate:@"This", @" is", @" a", @" test.", nil];

Now, the same thing with the category on NSArray looks like this:

NSString *test = @[ @"This", @" is", @" a", @" test." ].string;

Not as wordy and easier to type. I think I like it! Here’s a gist!


August 20, 2013

Sometimes you just want a simple UIPageViewController that you can just feed a bunch of view controllers (either already newed up or a list of class names) has a dotted page control at the bottom, and just works the way you would expect it to.

Well, here you go: https://github.com/jmenter/JMSimplePageViewController

Using UIViewController Class Inheritance with Nib Files

August 17, 2013

If you’re like me, you love using .xib files to specify what your user interfaces are to look like. One unfortunate side effect of using .xib files is that they do not easily lend themselves to class inheritance. Described here is a technique for using class inheritance with your UI elements laid out in .xib files.

For this example, we have a class hierarchy that looks like this:

UIViewController (included in UIKit)




JMViewController can be though of as the root of our specific view controller class hierarchy. It contains a view, IBOutlets, UILabels, UIButtons, etc. It also has a method that is going to be used by the view controller cubclasses:

– (void)addSubviewsFromSuperclass;

This method gets called in the – (void)viewDidLoad method of the subclasses and does this following:

  1. Gets a pointer to the current self.view property
  2. Loads the nib of the superclass, connects all inherited IBOutlets, and gets the main view (element 0)
  3. Reassigns the self.view property (the loadNibNamed method assigned it to the main view of the nib)
  4. Adds all subviews of the nib’s main view to our current view hierarchy
  5. (all this happens in a try/catch block in case something goes wrong with the nib loading process)

So, basically, the way to use class hierarchy with UIViewControllers that use .xib files is to call a special method that will unpack the view hierarchy of the superclass and add all elements to the current instance.

Check out the example project here!

Canon EOS M Not-Quite-A-Review

April 7, 2013

I normally talk about software development and computing generally here but I thought I would post a quick note about this new piece of camera gear that I got recently.

It’s a Canon EOS M, their first mirrorless interchangeable lens digital camera. I hadn’t planned on getting any new camera gear but I saw this camera with a 22mm ƒ/2 lens on sale at newegg.com for $450 so I grabbed one.

I’m not going to go over the basics (plenty of others have covered those aspects admirably), I’ll just point out a few things I’ve noticed in the week I’ve been playing around with it.

#1: the 22mm ƒ/2 lens that it comes with is really a nice lens. It’s a pancake lens so it doesn’t take up much room at all. On the APS-C sensor size of the EOS M the focal length equivalent comes out to 35mm which is a great “walk around and be able to catch everything” kind of lens. The ƒ/2 maximum aperture is quite fast considering its size. Overall I like it and will likely keep it on the camera as the main lens I use for photography.

#2: yes, the focusing system does suck that bad. The biggest complaint with this camera is that focusing is slow and unreliable and I’d have to agree with that wholeheartedly. I’m used to my 10D and 5D being able to focus in basically 1/4 a sec maximum (unless it’s REALLY dark), so waiting around for 2 to 6 seconds to get the focus right (assuming it doesn’t fail) is very very aggravating. Especially if you are using bigger apertures, getting the focus right is really important and the EOS M is the worst camera I’ve ever used in this respect.

#3: I’ll have to stop shooting in RAW mode. The 10D I’ve used for years produces RAW files of 4-6MB. The 5D just about doubles that. The EOS M doubles that again so now I’m looking at 20-30MB for each photograph I take with this camera. This is just unsustainable especially in the era of solid state hard drives. A high quality JPEG takes up just 3-6MB and I guess I’m going to have to live with that.

#4: The video from this camera is just amazing ASSUMING YOU FOCUS BEFOREHAND. You’ll get super high bitrate (around 45megabits/sec according to my tests) 1080p video from your favorite lenses. My favorite setting is “Neutral” with just a hint of sharpness added, a touch more saturation, and “Auto Optimized Lightness” which seems to boost the low/mids without blowing out the highlights (which seems to more closely match the gamma of film.) Shooting video with my Sigma 10-20mm ƒ/4-5.6 lens attached is my new favorite thing in the world. BUT, if you need to focus while you’re shooting video be prepared for frustration.

#5: Using Lens•Lab has really helped out with getting a feel for depth of field when shooting video. It’s a great feeling to use something you’ve made yourself to solve real world problems.

#6: strapping a normal lens (like the Sigma 10-20mm or the Canon 24-85mm) to the tiny EOS M body is a bit ridiculous.

All in all, I’d say the EOS M is a much more impressive video camera than it is a photography camera. It’s handy to carry around with the 22mm pancake prime (I’ll definitely use it in places where I don’t want to carry around the bag with the 5D, 10D, and lenses, batteries, etc.) But the focusing problems are really hard to look past.

It’s an odd duck. The tech specs and interchangeable lenses say semipro/pro but the tiny size and abhorrent focusing say “mediocre consumer photography gear.”

I still have a 5D and 10D around for doing “real” photography. But I think the EOS M will find a place in the jacket pocket or glove box or backpack far more often than the more pro level gear.

Check out some photos from the camera here: http://www.flickr.com/photos/jmenter and some video here: http://www.youtube.com/jeffmenter