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

Overview

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.

You might also like...
Dynamic textview with auto-resizing height & width that is also movable/draggable.
Dynamic textview with auto-resizing height & width that is also movable/draggable.

MarkupTextView Dynamic textview with auto-resizing height & width that is also movable/draggable. Requirements iOS 13 or above Installation MarkupText

Library that allows you binding `enabled` property of button with textable elements (TextView, TextField)
Library that allows you binding `enabled` property of button with textable elements (TextView, TextField)

What is NxEnabled? It's a fairly common case, when the enabled state of button depends on some textable elements such as TextView, TextField. So this

 MemojiView - MemojiView works by having a TextView behind the actual View for user input
MemojiView - MemojiView works by having a TextView behind the actual View for user input

MemojiView Since there is no official API for using the users Memoji's i have built a simple view to retrieve them and use them to your liking. Memoji

(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey 🍯 to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey 🍯 to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

SwiftSocket library provides the easy way to use sockets on Apple platforms

SwiftSocket library provides as easy to use interface for socket based connections on server or client side. Supports both TCP and UDP sockets.

IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.

Introduction Have you ever seen UI like instagram story, haven't you? Actually, features like instagram story have been implemented in many applicatio

Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶
Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶

RHSideButtons 🌶 Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app

MusicTheoryKit: a swift module that provides an easy-to-use API for most commonly used music terms

MusicTheoryKit Introduction MusicTheoryKit is a Swift framework that provides an easy-to-use API for most commonly used music terms. Create notes, ass

Swift-music - swift-music is a swift package that provides an easy-to-use API for music related developments.

🎼 swift-music Introduction swift-music is a swift package that provides an easy-to-use API for music related developments. Currently available module

OysterKit is a framework that provides a native Swift scanning, lexical analysis, and parsing capabilities. In addition it provides a language that can be used to rapidly define the rules used by OysterKit called STLR

OysterKit A Swift Framework for Tokenizing, Parsing, and Interpreting Languages OysterKit enables native Swift scanning, lexical analysis, and parsing

Provides a custom presentation modifier that provides more options including full screen presentations. (iOS)

Presentation Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a custom presentation modifier that provides more

AudioPlayer is syntax and feature sugar over AVPlayer. It plays your audio files (local & remote).

AudioPlayer AudioPlayer is a wrapper around AVPlayer. It also offers cool features such as: Quality control based on number of interruption (buffering

Instagram-like photo browser and a camera feature with a few line of code in Swift.
Instagram-like photo browser and a camera feature with a few line of code in Swift.

Fusuma is a Swift library that provides an Instagram-like photo browser with a camera feature using only a few lines of code.

VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.

CollectionViewShelfLayout A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested

Instagram-like photo browser and a camera feature with a few line of code in Swift.
Instagram-like photo browser and a camera feature with a few line of code in Swift.

NOTE: This project is no longer maintained. We highly recommend YPImagePicker. Fusuma Fusuma is a Swift library that provides an Instagram-like photo

Distributed actors transport example, for feature review

swift-sample-distributed-actors-transport Sample application and ActorTransport, associated with distributed actor language evolution proposal. Runnin

Swift Library based on AVFoundation that allow to easily add camera feature with custom UI into your project.
Swift Library based on AVFoundation that allow to easily add camera feature with custom UI into your project.

Would you like to create your camera same as Snapchat or Instagram? I think this library could help you. Basicly it is a wrapper above AVFoundation th

Comments
  • Facing a problem while explore with other language

    Facing a problem while explore with other language

    When i explore with Tamil (SouthIndian language) as tagging suggestion then the tagging attribute is not applied for a whole word.

    Solution:

    taggingAttributeRange should be like this NSMakeRange(model.range.location+1, model.text.utf16.count).

    need to get the characters count from utf16 encoding.

    it'll be good if apply the same for updateAttributeText method's selectedLocation param (For cursor placing).

    Refer the screenShots.

    flaw fix

    bug 
    opened by Arulmurugan-Sivapoosam 3
  • Not proper working when we start tagging initially.

    Not proper working when we start tagging initially.

    When I enter first "@" then it doesn't work properly and doesn't give exact match list. But when we enter some text and then I enter " @" it works properly. Please, check and let me know what I need to manage.

    opened by shivamsinha-quytech 0
  • Crash at updateAttributeText

    Crash at updateAttributeText

    It works well for the first time tag user using @ mentions. When I try same for the second time it crashes on the function:

    private func updateAttributeText(selectedLocation: Int) {

    Could not get the cause of this crash but it is important to me if it resolve asap. Thanks!

    Following is the crash log I'm getting:

    Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds' *** First throw call stack: (0x1831b3164 0x1823fc528 0x1831b30ac 0x183aaf594 0x183aaf9f0 0x10339e880 0x10339e9ac 0x1033a255c 0x103453c14 0x10339be4c 0x10339cc94 0x10339d484 0x18c9149ec 0x18c7ac294 0x18c9144d8 0x18c9136d0 0x18c913528 0x18c91345c 0x18cbd735c 0x18cbd665c 0x18d431fac 0x18c7975f0 0x183baf2e4 0x18315b77c 0x18315b6fc 0x18315af84 0x183158b5c 0x183078c58 0x184f24f84 0x18c7d15c4 0x1008a0da0 0x182b9856c) libc++abi.dylib: terminating with uncaught exception of type NSException

    opened by NirajCapermint 4
Releases(0.5.0)
Owner
DongHee Kang
Activate
DongHee Kang
Flutter plugin to display VGS card info using TextView or View

VGS Card Info Flutter plugin to display VGS Card info using TextView or View Installation Add the dependency in your pubspec.yaml vgscardinfo: git

Djamo Côte d'Ivoire 0 Mar 7, 2022
Library that allows you binding `enabled` property of button with textable elements (TextView, TextField)

What is NxEnabled? It's a fairly common case, when the enabled state of button depends on some textable elements such as TextView, TextField. So this

Nikita Ermolenko 33 Sep 20, 2021
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

Vladimir Kokhanevich 95 Nov 24, 2022
The famous iOS search bar with auto completion feature implemented.

PRESENTATION This search bar will allow you to offer suggestions words to your users when they are looking for something using default iOS search bar.

Boisney Philippe 182 Dec 23, 2022
Easy-to-use token field that is used in the Venmo app.

VENTokenField VENTokenField is the recipients token field that is used in the Venmo compose screen. Installation The easiest way to get started is to

Venmo 797 Dec 6, 2022
StyledTextKit is a declarative attributed string library for fast rendering and easy string building.

StyledTextKit is a declarative attributed string library for fast rendering and easy string building. It serves as a simple replacement to NSAttribute

GitHawk 1.2k Dec 23, 2022
A TextView that provides easy to use tagging feature for Mention or Hashtag

Tagging A TextView that provides easy to use tagging feature for Mention or Hashtag. Introduction Tagging is a UIView that encloses a TextView that co

DongHee Kang 109 Dec 5, 2022
Provides a SwiftUI multi-line TextView implementation including support for auto-sizing. (iOS)

TextView Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a SwiftUI multi-line TextView implementation with supp

SwiftUI+ 51 Jan 3, 2023
iOS hashtag generator, using image analysis and discovery

Tagger Description Want to be popular on some social network easily? Use Tagger to make your account content more popular and to raise your popularity

Ivan Magda 44 Dec 17, 2022
Flutter plugin to display VGS card info using TextView or View

VGS Card Info Flutter plugin to display VGS Card info using TextView or View Installation Add the dependency in your pubspec.yaml vgscardinfo: git

Djamo Côte d'Ivoire 0 Mar 7, 2022