Exclusion Paths

Exclusion Paths (shown in Figure 21.3) allow text to wrap around images or other objects that appear inline. iOS 7 added a simple property in order to add an exclusion path to any text container.

Image

Figure 21.3 Text wrapping around a UIImage using iOS 7’s exclusion paths.

To specify an exclusion path, a UIBezierPath representing the area to be excluded is first created. To set an exclusion path, an array of the avoided areas is passed to the exclusionPaths property of a textContainer. The text container can be found as a property of the UITextView.

- (void)viewDidLoad{    [super viewDidLoad];    UIBezierPath ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK 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.