为提及或主题标签提供易于使用的标记功能的文本视图

标记

构建状态
迅速
椰子足类
迦太基兼容

为提及或井号标签提供易于使用的标记功能的文本视图。

介绍

标记是一个 UIView,它包含一个包含标记算法的文本视图。
如果您担心在应用中实现或实现它们,可以使用库轻松实现它们。
MentionHashtag

标记

Getting Started

  1. Add to the view as a subview.Tagging

  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"]
Swift
  1. Implement TaggingDataSource on the class that added the .Tagging
tagging.dataSource = self
Swift
  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
}
Swift

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
Ruby

Carthage (iOS 8+)

github "k-lpmg/Tagging"
Ruby

LICENSE

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

GitHub

https://github.com/k-lpmg/Tagging