About Christopher Pickslay

Co-founder of Two Bit Labs, amateur haiku ninja.

Story-Centered Design

We like to get functional prototypes to stakeholders as early as possible in the development process. Prototypes help frame the discussion by putting features in context, helping teams make better design decisions and uncovering edge cases.

In this excellent piece on story-centered design, Braden Kowitz describes an approach that moves that kind of discussion back into the design process:

Designers present every sentence the customer reads, every action they take, and every screen that system generates in response. The designs follow a customer from an initial trigger all the way through completing a goal, and they show how the design supports every step in that flow.

Combining a design process like this with functional prototypes creates partnership between design and development teams that can lead to faster feature cycles, fewer bugs, and less rework by all involved.

Why good storytelling helps you design great products

Frame geometry macros to improve your UIKit code

Frame geometryI find myself doing more and more dynamic UI layout in iOS apps these days. When elements of a UI need to resize to fit their contents, or move to accommodate other elements, the layout code can get complex and verbose. We’ve developed a set of Objective-C UIKit macros that help make this code more readable, self-documenting, and easy to change.

When a view is offset from another view, you might write something like this:

someView.frame = CGRectMake(someOtherView.frame.origin.x + someOtherView.frame.size.width + padding...

These macros help make that code more concise and scannable:

someView.frame = CGRectMake(RIGHT(someOtherView) + padding...

You can download the macros from our TBMacros Github repo. First let’s take a look at an example Continue reading

Objective-C Blocks Cheat Sheet

iOS Blocks Objective-CBlocks are an incredibly powerful addition to Objective-C, introduced in iOS 4. However, their syntax can be maddeningly difficult to remember. Matt Gallagher has an excellent post that breaks down the syntax to help you understand it. If you haven’t read this article, go do it now.

Even after working with blocks for a while, I still get tripped up. So I created the cheat sheet below, which I frequently refer to when declaring blocks. Continue reading

Block initialization for testability and reuse

BlocksSince Apple introduced block support in iOS 4, more and more APIs are moving from delegation to block callbacks. While block callbacks can be declared inline, in most cases you should initialize your block callback in a method that returns the block. This keeps the code that calls an external API succinct, allows you to reuse the block in different contexts, and makes it easier to unit test the code in the block.

Let’s see what this looks like in practice.
Continue reading

Toward a better “Rate this app”

<3 <3 <3 Rate this app!!! <3 <3 <3If you’ve had an iPhone for any length of time, you’ve certainly had the experience of opening an app and facing a desperate plea for app store ratings. “Your reviews help other people find this app”, we’re told. And it’s true–app reviews and ratings are an important part of the app store ranking algorithm. Unfortunately, the state of the art in app rating is an approach that nags you when you open the app. Surely we can do better than that.

Continue reading

Initializing UIViewControllers

Most code samples that Apple provides for initializing a view controller look something like this:


MyController *myController = [[MyController alloc] initWithNibName:@"MyView" bundle:nil];

This always felt like a strange pattern to me. And as Ole Begemann recently pointed out, it’s poor encapsulation. Why does the caller specify which .xib file some other controller should use? Isn’t it the target controller’s responsibility to determine that?

Fortunately, there’s a better way. Continue reading

Git stash to store frequently used edits

Git Stash We work on a couple of projects that require specific changes to test a particular configuration, for example to test against a local server. We generally put this kind of configuration into a plist file and create a target that builds using that plist. Sometimes, however, that’s not convenient–for example, there may be several different potential servers to test against, and it makes more sense to manually edit the server configuration.

In that situation, I found myself frequently using git stash to set aside the server config while I switch branches or pull. It struck me that a stash is a good place to store that kind of configuration permanently. Since a stash, like any commit, stores just the diff, it can generally be re-applied even as the underlying file continues to change over time.

So I’ve started storing these quick configuration changes in stashes that are easy to locate and re-apply.

Continue reading

Symbolicating (mostly) fixed in Xcode 4.1

I previously posted why Xcode 4′s symbolication is broken, along with a patched script that fixes it. As of Xcode 4.1, Apple has fixed the problems in the symbolicatecrash script, though I’ve found that it still often does not symbolicate correctly. Here are the most common problems (and solutions) I’ve come across:
Continue reading