Skip to content

Ilesh/MentionsDisplayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Mention User

Swift 4.2 Platform: iOS XCode 11+ iOS 11+

Let's start

Here we're going to build a simple demo for mention user in the text. we can add user in the text and also the identify when we will send to the server whole text. It's working like the twitter mention user ;).

Getting Started

Here download the sample project and get necessory files for your existing project or create new project. please check some steps and instruction below for implementing in your project.

Note: I am assumes you are comfortable with the basics of storyboards and view controllers.

Installing

A regular way to use DropDown in your project would be using Embedded Framework. There are two approaches, using source code and adding submodule.

Add source code:

  • Download the latest code version.
  • Unzip the download file, copy DropDown folder to your project folder.
  • Customise cell abording your UI.

Usage

It is very easy to use only simply put configure methods in your "ViewdidLoad" method. Please find below code.

MyDropDown.shared.ConfigureMentionList(viewDropDown: txtView, successBlock: { (index, arrResult, strSearchKey) in
    let strName = arrResult[index]
    if  strSearchKey == "@" {
        self.txtView.text.append("\(strName) ")
    }else{
        self.txtView.text = self.txtView.text.replacingOccurrences(of: strSearchKey, with: "")
        self.txtView.text.append("@\(strName) ")
}

}) {

}

After that, implement textview or textField delegate methods for getting text for filter the list.

func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
        MyDropDown.shared.SearchMentionsTextFieldShowChagne(text: text, strFullString: textView.text ?? "")
return true
}

Contributing

  • If you need help or you'd like to ask a general question, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

👨🏻‍💻 Author

Buy Me A Coffee

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Credits

  • Thanks to "AssistoLab" for Amazing Dropdown repo.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published