Write a rich text view editor easily.
TODO
- Create your attachment object.
@interface DDImageAttachmentObject : DDAttachmentObject
@property (strong, nonatomic) UIImage *image;
@end
- Return your attachment view matched attachment object.
- (DDAttachmentReusableView *)textView:(DDAttachmentTextView *)textView attachmentViewWithAttachment:(DDTextAttachment *)attachment {
if ([attachment.data isKindOfClass:[DDImageAttachmentObject class]]) {
DDImageAttachmentView *view = [textView dequeueReusableAttachmentViewWithIdentifier:@"image"];
view.imageView.image = ((DDImageAttachmentObject *)attachment.data).image;
return view;
}
return nil;
}
- That's all!
MIT