/DDAttachmentTextView

A custom attachment rich text editor. 可自定义组件的富文本编辑器

Primary LanguageObjective-C

Custom RichTextView Belong to UITextView

Write a rich text view editor easily.

image

CoacoPods

TODO

How to use

  1. Create your attachment object.
@interface DDImageAttachmentObject : DDAttachmentObject
@property (strong, nonatomic) UIImage *image;
@end
  1. 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;
}
  1. That's all!

LISENCE

MIT