All Projects → tuesleep → Leotextview

tuesleep / Leotextview

Licence: mit
🐬A high-performance rich editor develop with swift on iOS platform, based on TextKit.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Leotextview

Roundprogresstextview
TextView with Round Pogress
Stars: ✭ 18 (-79.31%)
Mutual labels:  textview
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+988.51%)
Mutual labels:  rich-text-editor
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+1131.03%)
Mutual labels:  rich-text-editor
Android Justifiedtextview
android justified textview
Stars: ✭ 917 (+954.02%)
Mutual labels:  textview
Sodieremojikeyboardplus
支持自定义emoji表情,icon font , FontAwesome,斜体,超链接,粗体,下划线,字体,颜色,镂空字体等富文本
Stars: ✭ 14 (-83.91%)
Mutual labels:  rich-text-editor
Megadraft
Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility
Stars: ✭ 982 (+1028.74%)
Mutual labels:  rich-text-editor
Android Robototextview
Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.
Stars: ✭ 791 (+809.2%)
Mutual labels:  textview
French Press Editor
☕ An offline-first rich text editor component.
Stars: ✭ 69 (-20.69%)
Mutual labels:  rich-text-editor
Quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility.
Stars: ✭ 31,554 (+36168.97%)
Mutual labels:  rich-text-editor
Slate Edit Code
A Slate plugin for code block editing
Stars: ✭ 44 (-49.43%)
Mutual labels:  rich-text-editor
Justifytextview
Deprecated
Stars: ✭ 25 (-71.26%)
Mutual labels:  textview
Awesome Medium Editor
Medium.com WYSIWYG editor clone, with RTL support.
Stars: ✭ 12 (-86.21%)
Mutual labels:  rich-text-editor
Expandabletextview
实现类似微博内容,@用户,链接高亮,@用户和链接可点击跳转,可展开和收回的TextView
Stars: ✭ 992 (+1040.23%)
Mutual labels:  textview
Richtextfx
Rich-text area for JavaFX
Stars: ✭ 902 (+936.78%)
Mutual labels:  rich-text-editor
Android Material Design In Practice
A project to demonstrate the latest material design principles with simple examples. It has additional examples on how to easily scale texts on different screen sizes without extra effort.
Stars: ✭ 67 (-22.99%)
Mutual labels:  textview
Rskgrowingtextview
A light-weight UITextView subclass that automatically grows and shrinks.
Stars: ✭ 820 (+842.53%)
Mutual labels:  textview
Omegaanimatedtext
Animate bold and italic transformations in TextView
Stars: ✭ 35 (-59.77%)
Mutual labels:  textview
Ariana
Provide Multiple Gradients in ImageViews and Texts. Integrate with ViewPager to change colors dynamically.
Stars: ✭ 74 (-14.94%)
Mutual labels:  textview
Fole
Fole is a simple library to collapse and expand a TextView.
Stars: ✭ 67 (-22.99%)
Mutual labels:  textview
Rwidgethelper
Android UI 快速开发,专治原生控件各种不服
Stars: ✭ 996 (+1044.83%)
Mutual labels:  textview

LEOTextView

CI Status Version License Platform

LEOTextView is a very high-performance rich editor. Because it's a subclass of UITextView, not UIWebView. All of code by TextKit framework.

Features

  • Bold Text
  • Italic Text
  • Unordered List
  • Ordered List
  • List auto indentation
  • Undo and Redo
  • Rich Text Copy & Paste

Requirements

Xcode 8.3 or newer

Tag Swift
<= 0.4.x 2.2
>= 0.5.0 3.0
>= 0.7.0 4.0

Usage

Not extends any class, not EditorController and so on...

You can embed LEOTextView to anywhere that you want.

// Init TextView
let textView = LEOTextView(frame: self.view.bounds, textContainer: NSTextContainer())

// If you want to use built-in toolbar, call it.
textView.enableToolbar()

// add to View
self.view.addSubview(textView)

Done.

UITextViewDelegate

Some feature I use delegate method, so LEOTextView is delegate self. And provide another delegate property named leo_delegate

public var leo_delegate: UITextViewDelegate?

Public methods

Type transform

public func changeCurrentParagraphTextWithInputFontMode(mode: LEOInputFontMode)
public func changeSelectedTextWithInputFontMode(mode: LEOInputFontMode)

public func changeCurrentParagraphToOrderedList(orderedList isOrderedList: Bool, listPrefix: String)

Text attributes persistent

Get JSON by

public func textAttributesJSON() -> String

This method return a JSON string that contains all attributes needs to reload.

A unordered list

  • A
  • B
  • C

convert to JSON look like:

{
  "text": "- A\n- B\n- C",
  "attributes": [
  {
    "location": 0,
    "length": 11,
    "fontType": "normal",
    "name": "NSFont"
  },
  {
    "location": 0,
    "length": 11,
    "listType": 3,
    "name": "NSParagraphStyle"
  }
  ]
}

Set JSON and display to UITextView by

public func setAttributeTextWithJSONString(jsonString: String)

Or just set attributes only by

public func setAttributesWithJSONString(jsonString: String)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Cocoapods

LEOTextView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LEOTextView"

Author

Tuesleep, [email protected]

License

LEOTextView is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].