SUMMARY

This chapter explained how changes in screen orientation are handled by the various methods in the View Controller class. Proper handling of screen orientations will make your application more useable and improve the user experience.

EXERCISES

  1. Suppose you want your application to support only the landscape right and landscape left orientations. How should you modify your code?
  2. What is the difference between the frame and center property of a view?

Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Handling device rotations Implement the willRotateToInterfaceOrientation: and willAnimateRotationToInterfaceOrientation: methods.
Four orientations supported UIInterfaceOrientationPortraitUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRightUIInterfaceOrientationPortraitUpsideDown
Events fired when device is rotated willAnimateFirstHalfOfRotationToInterfaceOrientation:
Properties for changing the position of a view Use the frame property for changing the positioning and size of a view.

Use the center property for changing the positioning of a view.

Get Beginning iOS 5 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.