TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2016 |
Maintained by Mandea Daniel.
This is a wrapper over UITextView that offers support for finding and marking tags in the text entered. Take a look over example project in order to get the ideea.
To run the example project, clone the repo, and run pod install
from the Example directory first.
@property (weak, nonatomic) IBOutlet TagsTextView *tagsInputView;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// setup tags text view
// Setup Tags Text View
self.tagsInputView.tagsMarker = kTagsMarker;
self.tagsInputView.placeholderText = DESCRIPTION_TEXT_VIEW_PLACEHOLDER;
self.tagsInputView.textDefaultAttributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:15],
NSForegroundColorAttributeName:[UIColor blackColor],
NSBackgroundColorAttributeName: [UIColor whiteColor]};
self.tagsInputView.placeholderDefaultAttributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:15],
NSForegroundColorAttributeName:[UIColor lightGrayColor]};
self.tagsInputView.delegate = self;
}
#pragma mark - TagsTextViewDelegate
- (void)tagsTextViewUpdatedText:(NSString * __nullable)text {
// Here is all the string
}
- (void)tagsTextViewUpdatedTags:(NSArray * __nullable)tags {
NSMutableString *tagsString = [[NSMutableString alloc] init];
for (NSString *tag in tags) {
[tagsString appendString:[NSString stringWithFormat:@"%@ ", tag]];
}
self.relatedTagsLabel.text = tagsString;
}
iOS 8 or later
CCTagsTextView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CCTagsTextView"
Daniel Mandea, [email protected]
CCTagsTextView is available under the MIT license. See the LICENSE file for more info.