In the iPad application Pages, the user can manually enter text and place images/other media on the page- making the text flow dynamically around the media. As an example, see this picture. I also believe Apple said they’re not making any use of undocumented APIs, and any developer could theoretically recreate an app like Pages.
How can I recreate this within my app?
It doesn’t seem like the CTFrame class has any mechanism for this kind of wrapping with UIImageViews/UIWebViews/etc., and my knowledge of the Cocoa APIs is a bit limited, so I’m not sure where to look.
The
CTFramesetterCreateFramefunction has apathargument that you can use to wrap text around objects.Basically, you will have to construct a path that contains the total area that is to be filled with text, subtracting the areas that should be left free (your images).