/EasyMention

A Swift Library that made easy to implement mentions in a TextView

Primary LanguageSwiftMIT LicenseMIT

EasyMention

CI Status Version License Platform

A Swift Library that made easy to implement mentions in a TextView

Preview:

alt text

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift => 5
  • iOS => 10

Installation

Cocoapods

EasyMention is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'EasyMention'

Manual

simply copy classes folder to your project directory

How to Use

  • add a textView and change it super class to EasyMention
    @IBOutlet weak var mentionsTextView: EasyMention!
  • implement mentions delegate in your class
  extension ViewController: EasyMentionDelegate {...
  • set mentionDelegate to self
        mentionsTextView.mentionDelegate = self
  • set mentions to your textView with:
     self.mentionsTextView.setMentions(mentions: mentionItems)

async mention load from api

  func startMentioning(in textView: EasyMention, mentionQuery: String) {...

will called when user wants to start mentioning, you can sipmly call your api here and add resut to EasyMention mention items

See Eaxmple Project for more info

Made with Love in 🇮🇷

Morteza Gharedaghi: Morteza.ghrdi@gmail.com

Feel Free to create issue or open a pull request ☺️

Used in

send your application name to me,if you used this library

  • Wink App

License

EasyMention is available under the MIT license. See the LICENSE file for more info.