Latest 0.1.0
Homepage https://github.com/whichapp/mentionHashtagDetector
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Example

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

Description

whichappMHdetector can detect @ and # while you are typing or even if you move back cursor to a mention or hashtag word area and then you can edit it.

whichappMHdetectorwhichappMHdetector Hashtag

Usage

1- Import whichappMHdetector

import UIKit
import whichappMHdetector

2- make an instance of mentionHashtagDetector and set the delegates

//Making instance
let mentionHashtag = mentionHashtagDetector()
override func viewDidLoad() {
    super.viewDidLoad()

    ///Setting Delegates:
    //UITextView Delegate
    textView.delegate = self
    //mentionHashtagDetector Delegate
    mentionHashtag.delegate = self
}

3- call detectSign function each time text change, simply calling this function under textViewDidChange

extension ViewController:UITextViewDelegate {
    func textViewDidChange(_ textView: UITextView) {
        ///send every change in UITextView to the mentionHashtagDetector
        mentionHashtag.detectSign(textView: textView)
    }
}

4- listen to mentionHashtagDetectorDelegate

///Response of mentionHashtagDetector
extension ViewController:mentionHashtagDetectorDelegate {
    func didSignDetected(_ text: String, _ signType: signTypeModels) {
        //Print("(text)  Type=> (signType)")
    }
}

5- Done :)

Installation

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

pod 'whichappMHdetector'

Author

sajjadsarkoobi, [email protected]

License

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

Latest podspec

{
    "name": "whichappMHdetector",
    "version": "0.1.0",
    "summary": "Detecting @ and # in UITextView and UITextField.",
    "description": "Detecting Mention `@` and Hashtag `#` in UITextView and UITextField. it will automatically detect the word while user typing and distinguishing the type of it. you just need to set delegate and call mentionHashtagDetector func under the textDidChange(_:).",
    "homepage": "https://github.com/whichapp/mentionHashtagDetector",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "sajjadsarkoobi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/whichapp/mentionHashtagDetector.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.0",
    "source_files": "whichappMHdetector/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This