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...
A TextView that provides easy to use tagging feature for Mention or Hashtag
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

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

iOS hashtag generator, using image analysis and discovery
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

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

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,

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
iOS Developer 
DongHee Kang
Acčento is an easy-to-use tool for adding Czech diacritics to copied text.

Acčento is an easy-to-use tool for adding Czech diacritics to copied text. The app lives in the menu bar and is activated using a global hot key.

Matty Cross 3 Sep 16, 2021
A standalone, flexible API that provides a full-featured rich text editor for iOS applications.

Twitter Text Editor A standalone, flexible API that provides a full featured rich text editor for iOS applications. This provides a robust text attrib

Twitter 2.8k Dec 29, 2022
A simple library that provides standard Unicode emoji support across all platforms

Twitter Emoji (Twemoji) A simple library that provides standard Unicode emoji support across all platforms. Twemoji v13.1 adheres to the Unicode 13.0

Twitter 15k Jan 8, 2023
AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextView depending on the platform.

AttributedText AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextVi

null 1 Jul 18, 2022
MarkdownView is a WKWebView based UI element, and internally use bootstrap, highlight.js, markdown-it.

MarkdownView is a WKWebView based UI element, and internally use bootstrap, highlight.js, markdown-it.

Keita Oouchi 1.8k Dec 21, 2022
An easy way to add mentions to uitextview like Facebook and Instagram

OEMentions An easy way to add mentions to uitextview like Facebook and Instagram. It also include a tableview to show the users list to choose from. T

Omar Alessa 48 Oct 23, 2022
Write amazing, strong-typed and easy-to-read NSPredicate.

PredicateFlow Write amazing, strong-typed and easy-to-read NSPredicate. This library allows you to write flowable NSPredicate, without guessing attrib

Andrea Del Fante 103 Aug 12, 2022
Easy string decoration with styles

StyleDecorator Design string simply by linking attributes. Example Create Decorator with specific Style and link it at the end of needed string or wra

Dmytro Pylypenko 15 Nov 4, 2021
Easy Attributed String Creator

The main idea of this project is to have an online tool to be able to visually add formatting to a text and get back a swift and/or objective-c code t

Andres Canal 283 Dec 27, 2022