图1 |
图2 |
 |
 |
- 下载Demo项目,将YYRichEditor文件夹拖入工程中
- 在需要加入编辑器的界面加入代码:
self.textVc = [[YYTextViewController alloc] init];
self.textVc.delegate = self;
[self addChildViewController:self.textVc];
[self.view addSubview:self.textVc.view];
[self.textVc.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
- 实现
YYRichEditorDelegate
代理:
- (void)yy_editorDoneWithContentArray:(NSArray <YYTextItem *> *)contentArray originString:(NSString *)string;
- (NSString *)yy_saveImage:(UIImage *)image;
- 其他自定义配置查看
YYConfig.h
,最后运行查看效果。