O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Subview Clipping

Thanks to the natural pairing of the gesture recognizers and the affine transforms, we’ve added the dragging and pinch-zooming functionality that will be familiar to our users from many other apps they use. However, views that are allowed to just sprawl all over the screen aren’t something we usually see on iOS. It may be fun, but it feels wrong, and we hardly want to let the user make a mess of our user interface.

Let’s rein in the madness a little bit. We’ll put the image view into another view, and have it clipped off at that view’s edges. That will put an end to sliding the image offscreen or under the Done button.

In the storyboard, select the image view and delete it (with the Backspace key or the EditCut menu item). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required