Latest 1.0
Homepage https://github.com/sumitjagdev/SJTwitterTagInputTextView
License MIT
Platforms ios 8.0
Authors

[![CI Status](http://img.shields.io/travis/Sumit Jagdev/SJTwitterTagInputTextView.svg?style=flat)](https://travis-ci.org/Sumit Jagdev/SJTwitterTagInputTextView)
Version
License
Platform

Overview

SJTwitterTagInputTextView is a subclass of UIView, written in Swift, that enables the UIView to use as the "#" and "@" tag input view with suggestion list.

Requirements

  • ARC
  • iOS8

Example

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

Requirements

Installation

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

pod "SJTwitterTagInputTextView"

Usage

import SJTwitterTagInputTextView

@IBOutlet var tagInputView : SJTwitterTagInputTextView!
tagInputView.delegate = self

//TODO : Please add height constraint and set id of constraint = "SJTextViewHeight"
//MARK : SJTwitterTagInputTextViewDelegate
    func didSearchWithAtTag(tagString: String) {
        //        print("Current Search Word @ : ", tagString)

        let predicate = NSPredicate(format: "SELF contains[cd] %@", tagString)
        let array = allObjectList as NSArray!
        let newArray = array.filteredArrayUsingPredicate(predicate)

        tagInputView.allObjectList = newArray as! [String]

    }

    func didSearchWithHashTag(tagString: String) {
        //        print("Current Search Word # : ", tagString)

        let predicate = NSPredicate(format: "SELF contains[cd] %@", tagString)
        let array = allObjectList as NSArray!
        let newArray = array.filteredArrayUsingPredicate(predicate)

        tagInputView.allObjectList = newArray as! [String]
    }

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        print("All @ Tags : ", tagInputView.getAllAtTags())
        print("All # Tags : ", tagInputView.getAllHashTags())
    }

Author

Sumit Jagdev, [email protected]

License

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

Latest podspec

{
    "name": "SJTwitterTagInputTextView",
    "version": "1.0",
    "summary": "SJTwitterTagInputTextView is Twitter Style input text view for "@" tag and "#" tag",
    "description": "SJTwitterTagTextView for text input with suggestion.nIt's like Twitter for getting @ and # tag as input and showing Suggestion for tags and mentions in an Table view which will automatically appear when the user will input @ and # tag.",
    "homepage": "https://github.com/sumitjagdev/SJTwitterTagInputTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Sumit Jagdev": "[email protected]"
    },
    "source": {
        "git": "https://github.com/sumitjagdev/SJTwitterTagInputTextView.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SJTwitterTagInputTextView/Classes/**/*",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This