I can add image asynchronously seperately by using UIImageView+AFNetworking

[imageView setImageWithURL:[NSURL URLWithString:[self.data valueForKey:@"image_link"]]];

I can also add image to UITextView by

UITextView *text = [[UITextView alloc] init];
UIImageView *imageView = [UIImageView new];
[imageView setImage:[UIImage imageNamed:@"image.png"]];
CGRect aRect = CGRectMake(0, 0, 125, 120);
[imageView setFrame:aRect];

UIBezierPath *exclusionPath = [UIBezierPath bezierPathWithRect:aRect];
text.textContainer.exclusionPaths = @[exclusionPath];
[text addSubview:imageView];

But I cannot add image asynchronously in UITextView like

UITextView *text = [[UITextView alloc] init];
UIImageView *imageView = [UIImageView new];
[imageView setImageWithURL:[NSURL URLWithString:[self.data valueForKey:@"image_link"]]];
CGRect aRect = CGRectMake(0, 0, 125, 120);
[imageView setFrame:aRect];
UIBezierPath *exclusionPath = [UIBezierPath bezierPathWithRect:aRect];
text.textContainer.exclusionPaths = @[exclusionPath];
[text addSubview:imageView];

So how can I add image asynchronously in UITextView?

Related posts

Recent Viewed