Latest 3.0.8
Homepage https://github.com/hsusmita/SHRichTextEditorTools
License MIT
Platforms ios 10.0, requires ARC
Authors

This is a collection of extensions which are helpful in building a rich text editor.

Installation

You can use the basic setup and create your own editor, then add following lines in your pod file
pod ‘SHRichTextEditorTools/Core’, ‘~> 3.0.8’

If you want to use preconfigured text editor, you have to add the following lines in your pod file
pod ‘SHRichTextEditorTools/SHRichTextEditor’, ‘~> 3.0.8’

Usage

Basic

This library includes a basic editor SHRichTextEditor which includes basic functionalities like Bold, Italic and Indentation features.

let textEditor = SHRichTextEditor(textView: self.textView)
textEditor.toolBarItems = [textEditor.boldBarItem(), textEditor.italicBarItem(), textEditor.indentationBarItem()]

Custom TintColor

let textEditor = SHRichTextEditor(textView: self.textView, defaultTintColor: UIColor.gray, selectedTintColor: UIColor.green)

Customize bar button

let boldBarItem = self.textEditor.boldBarItem(type: .title(title: "Button")) { (button, selected) in
    button.barButtonItem.tintColor = selected ? UIColor.gray : UIColor.green
}
self.textEditor.toolBarItems = [boldBarItem]

Here type is defined by the following enum

public enum ButtonType {
    case title(title: String)
    case attributed(title: String, attributes: [UIControlState.RawValue: [NSAttributedStringKey : Any]])
    case image(image: UIImage)
}

Latest podspec

{
    "name": "SHRichTextEditorTools",
    "platforms": {
        "ios": "10.0"
    },
    "version": "3.0.8",
    "summary": "This is a collection of extensions which are helpful in configuring UIBarButtonItem to build a rich text editor",
    "authors": {
        "Susmita Horrow": "[email protected]"
    },
    "license": "MIT",
    "homepage": "https://github.com/hsusmita/SHRichTextEditorTools",
    "source": {
        "git": "https://github.com/hsusmita/SHRichTextEditorTools.git",
        "tag": "3.0.8"
    },
    "requires_arc": true,
    "swift_version": "4.2",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "SHRichTextEditorTools/Source/Core/**/*.{swift}",
            "preserve_paths": "SHRichTextEditorTools/Source/Core/**"
        },
        {
            "name": "SHRichTextEditor",
            "source_files": "SHRichTextEditorTools/Source/SHRichTextEditor/**/*.{swift}",
            "resources": [
                "SHRichTextEditorTools/Source/SHRichTextEditor/*.xcassets",
                "SHRichTextEditorTools/Source/SHRichTextEditor/**/*.{xib}"
            ],
            "dependencies": {
                "SHRichTextEditorTools/Core": [
                    "~> 3.0.8"
                ]
            }
        }
    ]
}

Pin It on Pinterest

Share This