Bug In Split View-based Application Template

July 12th, 2010

When you create a project using this template you get two controllers. One of them is DetailViewController that shows details of the selected item and also manages popover with items list. I've discovered that there is a subtle bug, and it hits you when you show another view controller modally.

Seems to be a rare case but I was showing registration screen, not that exotic feature!

How does it look like? Application loads and pulls data over the net to populate items list. When items list is ready the first item is set selected and shows in details controller. At this moment registration screen mysteriously disappears. Here is the code that updates details controller:

- (void)setDetailItem:(id)newDetailItem {
    if (detailItem != newDetailItem) {
        [detailItem release];
        detailItem = [newDetailItem retain];

        // Update the view.
        [self configureView];
    }

    if (popoverController != nil) {
        [popoverController dismissPopoverAnimated:YES];
    }
}

When I stopped in debugger it became obvious: dismissPopoverAnimated: was called and it just dismisses the current modal view controller! So the fix is to check whether the popover is actually visible, and what interesting is that there is a property for this: popoverVisible. Here is the fixed version of the method:

- (void)setDetailItem:(id)newDetailItem {
    if (detailItem != newDetailItem) {
        [detailItem release];
        detailItem = [newDetailItem retain];

        // Update the view.
        [self configureView];
    }

    if (popoverController && popoverController.popoverVisible) {
        [popoverController dismissPopoverAnimated:YES];
    }
}

The morale of the story: be precise when writing your code; avoid side-effects.

iPhone UI Design Essentials Notes

April 9th, 2010

Here are my notes for Apple dev video 'iPhone UI Design Essentials', you can get it at iPhone Dev Center. It's based on iPhone HIG and since you must read this document anyway you should already know most of what is presented. Below is what was refreshing and new for me.

Elegant Solution

Metric: users would recommend app to friends

That's a good one. If you work on an app or is using one ask yourself: 'Would you recommend this app to your friends?' Would you tweet or blog about the app? Does it fascinates you so much that you feel the urge to share the excitement? That's the ultimate goal of any design process.

Great Usability

'One door to each room': clear tree structure is essential

I've never consciously thought about this. But it just turns out that all my apps follow this principle. Looks like there is some truth in this guideline.

Clean layout: look for structural balance

Very interesting observation! When laying out views think of them as of physical objects stacked upon each other. The resulting construction should be balanced, proportional and stable. It's like building a house; maybe I should take some time to study architecture to improve UI design skill...

Finger-friendly targets: finger size is 44px by 44px, minimum is 44px by 22px never stacked vertically

I'm using 40px by 40px cells in Gaztrans so this is obviously the wrong size, will have to stretch them a bit.

Gorgeous Icon

Don't use text

Incorporate a strong silhouette

Two more simple rules that you may not thought of but which absolutely make sense. Even if you are not an artist and ask others to make icons for you keep this in mind to get the right icons.

High Fidelity UI

Tell a story using colors, textures and materials

Tactile design

The essential advice here is to imagine that your app is a physical object. So the more precisely you will reflect this in UI the better. If you have not noticed this yet the whole iPhone and Mac UI looks like it was made from interlocked metal, plastic and glass plates. So the idea to reflect physical objects in UI is mainstream and you are supposed to follow it.

Dynamic Content

Describe app updates, explain fixed bugs

What's interesting is that Apple itself does not quite follow this advice in OS X updates. Often update notes are limited to 'minor bugfixes'. Not sure whether this is really important.

Social features does matter (people love people)

I have not embraced this much yet but will do. I also think that sharing must provide some value, not just link to the app. Always think what content you could send from your app.

Provide 'Check for Purchases' button

If you have non-consumable purchases in your app this one should be in your checklist.

Animation

Use to mimic real life behavior

Extra point to the theme of designing an app as a representation of a physical object. The app should not just look like a physical object, it also should behave like a physical object. I suppose the whole idea of Core Animation was to support this point of view.

Sound

Makes app more immersive

The more human senses you are able to engage the better. And don't forget the main theme: your app should sound like an actual physical object. If you rotate a knob it should sound like a knob.

Use to reduce visual noise

Generally we use sound to confirm the action like button click but the idea here is that we can use sound instead of some UI parts. To put it simply you may replace confirmation dialog with confirmation sound when confirmation text is not very important.

Add sounds symmetrically

You see - the same theme once again: if the door opens in real world and you hear a sound then when the same door will close you should hear a closing sound. So the sounds you use in your application should be associated with the metaphor from physical world and be used consistently.

Polish

Alternative view in landscape mode

Actually that's my favorite feature; two orientations - two modes within one application. Standard sample is calculator: in portrait mode it's a simple calculator but in landscape it reveals additional buttons and becomes scientific calculator. Generally you may use landscape mode for zoomed version. Typical table has fixed width and scrolls vertically so in landscape mode it becomes wider. You may use this additional width to render text using larger font or use larger images.

Conclusion

Those videos are worth watching )))

Here is the link once more: iPhone Dev Center

LiveScore: Content is Everything

February 26th, 2010

I've seen this many times and it's always the same story: content is everything. If you want to secure a future it's not enough to write an excellent app, it's not enough to have a marketing plan; you must get access to attractive content. LiveScore app is an excellent example: at the moment of this writing it is available for several days in App Store and it ranks in Sports category like this:

Country Position
Belgium 1
Croatia 1
Denmark 1
Greece 1
Hong Kong 1
Hungary 1
Indonesia 1
Lebanon 1
Luxembourg 1
Malaysia 1
Portugal 1
Romania 1
Singapore 1
Thailand 1
Turkey 1
Vietnam 1
Austria 2
Czech Republic 2
Ireland 2
Netherlands 2
Poland 2
Slovakia 2
Australia 3
Finland 3
Norway 3
Sweden 3
Switzerland 3
United Arab Emirates 3
Italy 4
Russia 4
UK 4
Argentina 5
Chile 5
Germany 6
France 7
India 10

and so on...

LiveScore

Note that there are no excessive graphic overlays or fancy logos, most of the screen is filled with data. And this data is what people want this application for, that is what they need in the end.

Combined with authentic data sources I believe that this application will be the default source of information about sport scores in App Store. And this should be a model of how developers could organize their business.