In the function - (CFIndex)characterIndexAtPoint:(CGPoint)point {} .I think it is necessary to add a judgement, because not every attributeText must have NSParagraphStyle attribute. i have tested that if an attributeText does not have NSParagraphStyle attribute,there will be a crash in this function. Following is my suggestion:
In the function - (CFIndex)characterIndexAtPoint:(CGPoint)point {} .I think it is necessary to add a judgement, because not every attributeText must have NSParagraphStyle attribute. i have tested that if an attributeText does not have NSParagraphStyle attribute,there will be a crash in this function. Following is my suggestion:
`[self.attributedText enumerateAttribute:(NSString)kCTParagraphStyleAttributeName inRange:NSMakeRange(0, [optimizedAttributedText length]) options:0 usingBlock:^(id value, NSRange range, BOOL stop) {
`