POWERED by FUSION

My name is Jake Marsh. I'm a developer, designer, and writer.


Subscribe via RSS or Twitter.

The Metaphors Breaking The Future

Posted

Calendar, Notes and Contacts are all explainable — they reference real world things (even if they shouldn’t). My Mum likes that her calendar looks more like a Filofax than Outlook 2003. Fair enough. A Filofax is a thing. I get it. And the Compass app is based on a compass. Another thing.

But I’m pretty sure there’s not a thing in my physical living room called a ‘Find My Friends’. The metaphor is empty. It’s not referring to anything. It’s just a leather texture.

A great piece about skeuomorphic design by Jon Gold

Show TODO's And FIXME's As Warnings In Xcode 4

Posted


Here's a neat little snippet for Xcode 4 that will cause all of your //TODO: and //FIXME: comments in your code to appear as compiler warnings when you build. Here's how to use it:

Instructions

  • Head over to your project's item in the Project Navigator (usually at the very top)
  • Find your target in the list of targets on the left, select it
  • Head over to the "Build Phases" tab.
  • Click the "Add Build Phase" in the bottom right of this screen.
  • In the editor that appears insert the bash script shown below.

Now just build and you'll see all your //TODO: and //FIXME: comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.

Bash Script For "Run Script" Build Phase

KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"

You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original //TODO: or //FIXME:

Extra pro tip: Make sure you're using phrases to describe your //TODO: comments like //TODO: Handle this error gracefully, and things like that. The phrases will show up in the issues list beside each warning.

Credit for the little tidbit should go to "Tim" on the Cocos2D forums, (found after Googling for a bit), I believe his solution originally was intended for Xcode 3 and didn't work if you had spaces in your path name, my script here doesn't have those restrictions, still he should get full credit here's his original post.

Save Time and Code With JMWhenTapped

Posted

I've just released a new little helper library for iOS development. It's called JMWhenTapped. It's is a simple little syntactical-sugar addition to all UIView objects, as well as any class that inherits from UIView. It allows you to assign touch-up, touch-down, and tapped (touched down then up) actions to a UIView object using a convenient blocks-style syntax.

Installation

Clone the repo. Add the JMWhenTapped folder to your iOS 4 project. #import "JMWhenTapped.h" wherever you'd like to use the syntax.

Examples & Usage

Use it like this:

[myView whenTapped:^{
    NSLog(@"I was tapped!");
}];

Or like this:

[myView whenTouchedDown:^{
    NSLog(@"I was touched down!");
}];

And also like this:

[myView whenTouchedUp:^{
    NSLog(@"I was touched up!");        
}];

The Different Actions

The whenTapped: method should be used in cases where you simply want something to happen when the user taps on a view (i.e. you are concerned with performing some action when their finger is down then up, like changing to a "pressed" state.)

The whenTouchedDown: method should be used when you want to trigger some action when the user touches down on your view.

The whenTouchedUp: method should be used when you want to trigger some action when the user touches up on your view.

Demo

Included in the repo is a demo Xcode project that illustrates a quick example of how to use JMWhenTapped.