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.


