Drawing Text and Shadows
While we are talking about drawing, let’s add some text with a shadow to the view, as shown in Figure 6.3.
Figure 6.3 View that draws text
Open HypnosisView.m and add the following code to the end of your drawRect: method:
for (float currentRadius = maxRadius; currentRadius > 0; currentRadius -= 20) { CGContextAddArc(context, center.x, center.y, currentRadius, 0, M_PI * 2.0, YES); ...
Get iOS Programming: The Big Nerd Ranch Guide, Second Edition 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.