CoreTextArcView in iOS
Join the DZone community and get the full member experience.Join For Free
Ever tried to adapt CoreTextArcCocoa to iOS and decided in short order “nah, the artists can sort this out?” Yep, us too. For next time that situation comes up, there’s a good-looking port of it to be found in this Stack Overflow question:
I adapted the CoreTextArcCocoa sample project, above for my own use, and thought I’d share it here.
I added a few other features as well, such as the ability to set the arc size to something smaller than 180, and the text color and offset shift as properties (so that you don’t have to have a huge frame to show the whole text).
File: CoreTextArcView.m (iOS version)
Abstract: Defines and implements the CoreTextArcView custom UIView subclass to draw text on a curve and illustrate best practices with CoreText…
Yep, that’s some handy stuff. Grab it from the link and give it a voteup!
Published at DZone with permission of Alex Curylo, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.