Skip to Content
Beginning iOS 5 Application Development
book

Beginning iOS 5 Application Development

by Wei-Meng Lee
January 2012
Beginner content levelBeginner
655 pages
16h 35m
English
Wrox
Content preview from Beginning iOS 5 Application Development

SUMMARY

In this chapter, you have seen the usefulness of the NSTimer class and how it can help you perform some simple animations. You have also learned about the various affine transformations supported by the iOS SDK. Next, you learned how the Image View enables you to animate a series of images at a regular time interval. Last, but not least, you learned how to play back a video in your iPhone application.

EXERCISES

  1. Name the three affine transformations supported by the iPhone SDK.
  2. How do you pause an NSTimer object and then resume it?
  3. What is the purpose of enclosing your block of code using the animateWithDuration:delay:options:animations:completion: method of the UIView class, as shown in the following code snippet?
    [UIView animateWithDuration:slider.value
                          delay:0.0f
                        options:UIViewAnimationOptionAllowUserInteraction ||
                                 UIViewAnimationOptionCurveLinear
                    animations:^{
                        //---code to effect visual change---
                    }
                    completion:nil];
  4. Name the class that you can use for video playback.

    Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Using the NSTimer object to create timers Create a timer object that will call the onTimer method every half-second:
timer = [NSTimer scheduledTimerWithTimelnterval: 0.5
                       target:self
                     selector:@selector(onTimer)
                     userInfo:nil
                      repeats:YES];
Stopping the NSTimer object
[timer invalidate]; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering iOS 12 Programming - Third Edition

Mastering iOS 12 Programming - Third Edition

Donny Wals
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9781118144251Purchase book