O'Reilly logo

The Core iOS Developer’s Cookbook, Fifth Edition by Rich Wardwell, Erica Sadun

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

Testing Touches

Recipe 2-8 limits interactions in two ways. First, the user must touch inside the ribbon art to begin interaction. If the user touches anywhere other than the ribbon, the touch falls through, and the control does not respond to it, even though touches may have begun on top of the control’s frame. Second, the recipe tests against the ribbon bitmap to ensure that touches began on a solid (nontransparent) part of the art. As you can see in Figure 2-7, a notch appears at the bottom of the artwork. Touches in this notch won’t start a tracking sequence. The recipe compares the touch position with pixels in the art. If the transparency (alpha level) of the art falls below 85 (about 67% transparent), the touch won’t connect with the ribbon. ...

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