I am creating a reader app using UITextView
and NSAttributedString
, I need to split whole attributedString into smaller amount of attributed string to enable Pages Concept.
I have method for calculating frame size of given attributed string.
CGRect rect = [attrString boundingRectWithSize:CGSizeMake(768, 10000) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil];
But I need to get attributeString for (768, 1024) ContentSize.
I have used this, but the attributedStrings are not correctly divided, because it contains NSTextAttachment
and HTML
stings.
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)delegate.attributedString);
How can I calculated this? and It need to be fast and need to takes small amount of memory.