https://github.com/mor4eza/easymention
A Swift Library that made easy to implement mentions in a TextView
https://github.com/mor4eza/easymention
Last synced: 9 months ago
JSON representation
A Swift Library that made easy to implement mentions in a TextView
- Host: GitHub
- URL: https://github.com/mor4eza/easymention
- Owner: Mor4eza
- License: mit
- Created: 2019-09-29T05:54:27.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T13:14:43.000Z (almost 7 years ago)
- Last Synced: 2025-03-01T16:36:16.465Z (over 1 year ago)
- Language: Swift
- Size: 1.18 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EasyMention
[](https://travis-ci.org/Mor4eza/EasyMention)
[](https://cocoapods.org/pods/EasyMention)
[](https://cocoapods.org/pods/EasyMention)
[](https://cocoapods.org/pods/EasyMention)
A Swift Library that made easy to implement mentions in a TextView
Preview:

## 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](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'EasyMention'
```
**Manual**
simply copy classes folder to your project directory
# How to Use
- add a textView and change it super class to **EasyMention**
```swift
@IBOutlet weak var mentionsTextView: EasyMention!
```
- implement mentions delegate in your class
```swift
extension ViewController: EasyMentionDelegate {...
```
- set mentionDelegate to self
```swift
mentionsTextView.mentionDelegate = self
```
- set mentions to your textView with:
```swift
self.mentionsTextView.setMentions(mentions: mentionItems)
```
**async mention load from api**
```swift
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.