GithubHelp home page GithubHelp logo

ajaybhanushali / shrichtexteditortools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsusmita/shrichtexteditortools

0.0 1.0 0.0 421 KB

This is a collection of extensions which are helpful in configuring UIBarButtonItem to build a rich text editor

License: MIT License

Ruby 1.41% Swift 98.59%

shrichtexteditortools's Introduction

#SHRichTextEditorTools 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', '~> 4.0.7'

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

#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)
}

shrichtexteditortools's People

Contributors

hsusmita avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.