How to rotate the text fragments of a NSTextContainer in a UITextView?

315 views Asked by At

I'm using a UITextView and want to change the angle of the text fragments as described in the drawing below.

The current result shows my actual way:

frameText.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle), 0, 0, 1);

enter image description here

As described by Ray Wenderlich in his Text Kit tutorial a TextView is separeated into several classes:

enter image description here

I know, it is possible to define size and position of a text fragement in a custom NSTextContainer e.g. using the

(CGRect)lineFragmentRectForProposedRect:(CGRect)proposedRect atIndex:(NSUInteger)characterIndex writingDirection:(NSWritingDirection)baseWritingDirection remainingRect:(CGRect *)remainingRect {...} method.

But I can't find a way to rotate the text fragments directly. Does anyone have an idea how to achieve this?

0

There are 0 answers