• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

aryaxt/iOS-Rich-Text-Editor: A Rich Text Editor for iOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

aryaxt/iOS-Rich-Text-Editor

开源软件地址:

https://github.com/aryaxt/iOS-Rich-Text-Editor

开源编程语言:

Objective-C 99.5%

开源软件介绍:

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;
}

Modal Presentation Style

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
matrix-org/matrix-ios-sdk: The Matrix SDK for iOS发布时间:2022-06-22
下一篇:
forem/DEV-ios: DEV Community iOS App发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap