Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

10. Working with Text > Recipe: Drawing into Nonrectangular Paths

Recipe: Drawing into Nonrectangular Paths

Recipes 10-16 and 10-17 used rectangles to bound the displayed text, but there’s no reason on modern iOS devices not to use more challenging path shapes. Recipe 10-18 introduces code that draws the shaped text shown in Figure 10-12. To achieve this effect requires little more than changing the path from a rectangle to an ellipse. In addition, the recipe adds a little extra Quartz drawing to provide the backdrop and the outer stroke.

Image

Figure 10-12. Using circles and ellipses (or any other shaped path) can produce eye-catching visual elements in your applications.

It’s easy to extend this approach to quite silly extremes, as demonstrated in Figure 10-13. These were a couple of sample images I created for fun while working on Recipe 10-18. They were built by creating complex path elements using mutable paths in Quartz.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint