TextKitEditor
TextKitEditor copied to clipboard
Endless recursive call
In TKELayoutManager.m:
// The additional indent is the distance from the first to the last character
leftInset += [self locationForGlyphAtIndex:firstTextGlyphIndex].x - [self locationForGlyphAtIndex:firstGlyphIndex].x;
But, -[NSLayoutManager locationForGlyphAtIndex:] may call -[NSTextContainer lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:] by default.
In TKETextContainer.m:
UIEdgeInsets insets = [(TKELayoutManager *)self.layoutManager insetsForLineStartingAtCharacterIndex: characterIndex];
rect.size.width -= insets.left + insets.right;
return rect;
Which causes endless recursive call and crashes the application.