All Projects → Andrew-Chen-Wang → RichEditorView

Andrew-Chen-Wang / RichEditorView

Licence: BSD-3-Clause license
Rich Text Editor in Swift. Newly Featured Code and Swift 5 compatible of cjwirth/RichEditorView.

Programming Languages

swift
15916 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to RichEditorView

BottomSheet
A sliding Sheet from the bottom of the Screen with 3 States build with SwiftUI.
Stars: ✭ 597 (+468.57%)
Mutual labels:  swift5
cazary
jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.
Stars: ✭ 12 (-88.57%)
Mutual labels:  rich-text-editor
awesome-ios
A collaborative list of awesome for iOS developers. Include quick preview.
Stars: ✭ 1,329 (+1165.71%)
Mutual labels:  swift5
quilljs-rails
Easy integration of Quill rich editor with most Rails forms.
Stars: ✭ 33 (-68.57%)
Mutual labels:  rich-text-editor
graphique
Experimental GraphQL query builders
Stars: ✭ 24 (-77.14%)
Mutual labels:  swift5
LongWeekend-iOS
🏖📱 LongWeekend is iOS Application that supports checking long weekends when taking a vacation in Japan
Stars: ✭ 19 (-81.9%)
Mutual labels:  swift5
wysihtml5-rails
A wysiwyg text editor for use in the Rails asset pipeline
Stars: ✭ 28 (-73.33%)
Mutual labels:  rich-text-editor
XYColor
An easy way to adapter dark mode on CALayer. iOS 快速适配夜间模式
Stars: ✭ 76 (-27.62%)
Mutual labels:  swift5
CircularRevealKit
Circular reveal animations made easy
Stars: ✭ 24 (-77.14%)
Mutual labels:  swift5
VideoTimelineView
Video timeline UI for iOS Apps
Stars: ✭ 103 (-1.9%)
Mutual labels:  swift5
LeagueAPI
League of Legends API & Data Framework in Swift
Stars: ✭ 50 (-52.38%)
Mutual labels:  swift5
bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io
Stars: ✭ 541 (+415.24%)
Mutual labels:  rich-text-editor
xcframework
A simple tool to create an XCFramework
Stars: ✭ 77 (-26.67%)
Mutual labels:  swift5
ngx-quill-lite
A light weight Angular wrapper of Quilljs, powerful rich text editor
Stars: ✭ 20 (-80.95%)
Mutual labels:  rich-text-editor
StoreHelper
Implementing and testing In-App Purchases with StoreKit2 and StoreHelper in Xcode 13, Swift 5.5, SwiftUI, iOS 15 and macOS 12.
Stars: ✭ 158 (+50.48%)
Mutual labels:  swift5
QuoteKit
A framework to use the free APIs provided by https://quotable.io
Stars: ✭ 17 (-83.81%)
Mutual labels:  swift5
stinsen
Coordinators in SwiftUI. Simple, powerful and elegant.
Stars: ✭ 563 (+436.19%)
Mutual labels:  swift5
am-editor
A rich text collaborative editor framework that can use React and Vue custom plug-ins. 一个富文本实时协同编辑器框架,可以使用React和Vue自定义插件。
Stars: ✭ 542 (+416.19%)
Mutual labels:  rich-text-editor
wordpress-froala-wysiwyg
Wordpress plugin for Froala WYSIWYG HTML Editor.
Stars: ✭ 38 (-63.81%)
Mutual labels:  rich-text-editor
Harbour
Docker/Portainer management app for iOS
Stars: ✭ 210 (+100%)
Mutual labels:  swift5

RichEditorView

This is the Swift 5 version of cjwirth/RichEditorView using WKWebView that added several awesome functionalities.

Table of Contents:

  • Usage Instructions
  • Added Features
  • Credits and License

Usage Instructions:

You can use SPM to install this package. If you're using Pods or Carthage, since I haven't created a package for those yet, you'll need to do this manually.

  1. In order to import the RichEditorView package, you need to create a new group/folder by going to the bottom left of XCode and clicking on the + button. Create a new group called RichEditorView.
  2. Then, manually create new files and copy and paste accordingly from the RichEditorView directory in the source code. There is currently no plan to go to CocoaPods or Carthage or any other package manager.
  3. For resources, if you download this repository via ZIP and then unzip the file, you can right click on YOUR newly created Resources directory and selecting "Add Files to" then select the Resource files from the unzipped package. DO NOT USE Assets!!!

Added Features:

Most features are the same from the parent repo, but I have added some other functionalities and some directions in the sample. Other features can be found in cjwirth's repo.

The following edited features assumes you have a property let editorView = RichEditorView()

  1. You can get selected text by doing editorView.getSelectedText
  2. runJS and other functions in the RichEditorView does NOT work like cjwirth's. This is due to the JavaScript bridging for WKWebView; unlike WK, UIWebView had a string be returned. In order to run JavaScript and other functionalities return Void, you must do the following:
editorView.getSelectedText() { r in
    // r is just a variable.
}

or

editorView.runJS("document.getElementById('editor')") { r in 
    print(r)
}

NOTE That these might run asynchronously. This might be due to WKWebView's memory efficiency feature. Don't quote me on that though, since I'm not too sure if that's true. Just an observation. This is because the function is: public func getSelectedText(handler: @escaping (String) -> Void). Notice the (String) -> Void. The variable r is the string value returned by JavaScript.

  1. The insertLink functionality has also changed. Normal tags in HTML are layed out like this: <a href="https://github.com/" title="GitHub">The TEXT that user sees</a>. When you insert a link, the following arguments are required: href and text. If there is a range selection, the text in the range selection will be cleared!
  2. Dark mode is included via the CSS and HTML files.

Credits and License

License is under BSD-3 Clause

cjwirth - Original iOS-RichEditorView Creator

C. Bess - WKWebView Support

YoomamaFTW - Repository Maintainer

Andrew-Chen-Wang - Repository Maintainer

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].