I have a variable attribute string to which I have added an embedding of the image text.
NSMutableAttributedString* attributedString = [_textField.attributedText mutableCopy];
NSMutableDictionary* dict = [_homeFeedCommentsViewController.inputData.array_extraElements objectAtIndex:0];
NSNumber* indexObject = [NSNumber numberWithUnsignedLong:attributedString.length];
[dict setObject:indexObject forKey:@"LocationIndex"];
[attributedString insertAttributedString:imageAsAttributedString atIndex:attributedString.length];
How can I now get into this text attachment and replace it with a line in the place where the image is supposed to be in the text?
source
share