A Swift Library that made easy to implement mentions in a TextView
Preview:
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift => 5
- iOS => 10
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
- 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
Morteza Gharedaghi: Morteza.ghrdi@gmail.com
Feel Free to create issue or open a pull request
send your application name to me,if you used this library
- Wink App
EasyMention is available under the MIT license. See the LICENSE file for more info.