iOS-Rich-Text-Editor

A Rich Text Editor for iOS

  • 所有者: aryaxt/iOS-Rich-Text-Editor
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

RichTextEditor-iOS Version

RichTextEditor for iPhone & iPad

Features:

  • Bold
  • Italic
  • Underline
  • StrikeThrough
  • Font
  • Font size
  • Text background color
  • Text foregroud color
  • Text alignment
  • Paragraph Indent/Outdent

alt tag

alt tag

Custom Font Size Selection

Font size selection can be customized by implementing the following data source method

- (NSArray *)fontSizeSelectionForRichTextEditor:(RichTextEditor *)richTextEditor
{
	// pas an array of NSNumbers
	return @[@5, @10, @20, @30];
}

Custom Font Family Selection

Font family selection can be customized by implementing the following data source method

- (NSArray *)fontFamilySelectionForRichTextEditor:(RichTextEditor *)richTextEditor
{
	// pas an array of Strings
  // Can be taken from [UIFont familyNames]
	return @[@"Helvetica", @"Arial", @"Marion", @"Papyrus"];
}

Presentation Style

You can switch between popover, or modal (presenting font-picker, font-size-picker, color-picker dialogs) by implementing the following data source method

- (RichTextEditorToolbarPresentationStyle)presentarionStyleForRichTextEditor:(RichTextEditor *)richTextEditor
{
  // RichTextEditorToolbarPresentationStyleModal Or RichTextEditorToolbarPresentationStylePopover
	return RichTextEditorToolbarPresentationStyleModal;
}

When presentarionStyleForRichTextEditor is a modal, modal-transition-style & modal-presentation-style can be configured

- (UIModalPresentationStyle)modalPresentationStyleForRichTextEditor:(RichTextEditor *)richTextEditor
{
	return UIModalPresentationFormSheet;
}

- (UIModalTransitionStyle)modalTransitionStyleForRichTextEditor:(RichTextEditor *)richTextEditor
{
	return UIModalTransitionStyleFlipHorizontal;
}

Customizing Features

Features can be turned on/off by iplementing the following data source method

- (RichTextEditorFeature)featuresEnabledForRichTextEditor:(RichTextEditor *)richTextEditor
{
   return RichTextEditorFeatureFont, RichTextEditorFeatureFontSize, RichTextEditorFeatureBold, RichTextEditorFeatureParagraphIndentation;
}

Enable/Disable RichText Toolbar

You can hide the rich text toolbar by implementing the following method. This method gets called everytime textView becomes first responder.
This can be usefull when you don't want the toolbar, instead you want to use the basic features (bold, italic, underline, strikeThrough), thoguht the UIMeMenuController

- (BOOL)shouldDisplayToolbarForRichTextEditor:(RichTextEditor *)richTextEditor
{
   return YES;
} 

Enable/Disable UIMenuController Options

On default the UIMenuController options (bold, italic, underline, strikeThrough) are turned off. You can implement the follwing method if you want these features to be available through the UIMenuController along with copy/paste/selectAll etc.

- (BOOL)shouldDisplayRichTextOptionsInMenuControllerForRichTextrEditor:(RichTextEditor *)richTextEdiotor
{
   return YES;
} 

Credits

iPhone popover by werner77
https://github.com/werner77/WEPopover

主要指标

概览
名称与所有者aryaxt/iOS-Rich-Text-Editor
主编程语言Objective-C
编程语言Objective-C (语言数: 2)
平台
许可证Other
所有者活动
创建于2013-05-06 05:34:01
推送于2016-07-13 09:19:49
最后一次提交2015-04-20 14:49:29
发布数1
最新版本名称0.0.1 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数896
关注者数61
派生数156
提交数83
已启用问题?
问题数50
打开的问题数32
拉请求数12
打开的拉请求数2
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?