Channels ▼


Developing for the iPad

Communication through Animation

Animation is also an important topic for any iPad or iPhone application. Meaningful animations can help your users understand what the application is doing and how to interact with it. Animations can show the user what they just did (such as deleting or adding a row in a table, or changing a property) and also help them understand how that change affected the rest of the application. In Ideate we have a few animations and are planning to add more as they are needed.

One current animation in Ideate hides the tool tray when the user is editing an image clip. Image clips can be edited with a "long press," when the user presses and holds their finger on the clip for about half a second. Enabling animations is as simple as telling the view to start animating changes, then telling it when you're done making changes:

- (void) hideAnimated {
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:0.15];
	CGRect frame = self.view.frame;
	frame.origin.x = -TOOL_TRAY_WIDTH;
	self.view.frame = frame;
	[UIView commitAnimations];

This code begins animations, then sets their length to 0.15 seconds, moves the tool tray off screen to the left, then commits animations. The Core Animation framework records all of the changes to animatable properties that occur between calls to beginAnimations and commitAnimations and then animates them over the duration of the activity.

If you read the value of self.view.frame immediately after this code, it will look like the animation has already completed. Some animation systems will report the current value of a property while it is animating, but it is more convenient if the final value is reported. This is particularly true if you have code that operates further on animated properties, or if your code checks to see whether it needs to move the view further. If the current value of a property is required, it can still be obtained by asking the main CALayer of the UIView for its presentationLayer.

Bringing it All Together

The iPhone SDK is designed to help you build a great application for the iPad, iPhone or iPod Touch. Read Apple's Human Interface Guidelines and Programming Guides for the best overview on application development issues. As you work on your application, be aware of how your technology solutions impact the user experience. At EffectiveUI, we are proud to have developed Ideate for the iPad launch, and we expect to leverage our experience to further improve the app and to build future apps as well.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.