Git Product home page Git Product logo

tagging's Introduction

Tagging

Build Status Swift Cocoapods Carthage compatible

A TextView that provides easy to use tagging feature for Mention or Hashtag.

Introduction

Tagging is a UIView that encloses a TextView that contains an algorithm for tagging. If you're worried about implementing Mention or Hashtag in your app, you can easily implement them using the library.

tagging

Getting Started

  1. Add Tagging to the view as a subview.

  2. Set the list that you want to tag and tag symbol to Tagging.

tagging.symbol = "#"
tagging.tagableList = ["DOOMFIST", "GENJI", "MCCREE", "PHARAH", "REAPER", "SOLDIER:76", "SOMBRA", "TRACER", "BASTION", "HANZO", "JUNKRAT", "MEI", "TORBJORN", "WIDOWMAKER", "D.VA", "ORISA", "REINHARDT", "ROADHOG", "WINSTON", "ZARYA", "ANA", "BRIGITTE", "LUCIO", "MERCY", "MOIRA", "SYMMETRA", "ZENYATTA"]
  1. Implement TaggingDataSource on the class that added the Tagging.
tagging.dataSource = self
  1. Get tagable list and tagged list through TaggingDataSource.
func tagging(_ tagging: Tagging, didChangedTagableList tagableList: [String]) {
    matchedList = tagableList
}

func tagging(_ tagging: Tagging, didChangedTaggedList taggedList: [TaggingModel]) {
    self.taggedList = taggedList
}

Usage

Tagging Property

Property Type Description
cornerRadius CGFloat Corner radius
borderWidth CGFloat Border width
borderColor CGColor Border color
textInset UIEdgeInsets Text inset
backgroundColor UIColor Background color
symbol String Tagging symbol
tagableList [String] Tagable list
defaultAttributes [NSAttributedStringKey: Any] Default attributes for all range attributedText of Textview
symbolAttributes [NSAttributedStringKey: Any] Aattributes for symbol text
taggedAttributes [NSAttributedStringKey: Any] Attributes for tagged text

Installation

CocoaPods (iOS 8+)

platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Tagging'
end

Carthage (iOS 8+)

github "k-lpmg/Tagging"

LICENSE

These works are available under the MIT license. See the LICENSE file for more info.

tagging's People

Contributors

k-lpmg 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.