Skip to content

potlee/TaggableTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TaggableTextView

Customizable UITextView subclass that supports tagging.

How to use it.

You need to subclass TaggableTextView and do this:

//REQUIRED
_text_view = [[TaggableTextViewSubclass alloc] initWithFrame: CGRectMake(20, 200, 280, 100)];
[_text_view setText:@"This text is taggable"];

//Optional customization
_text_view.tagPrefix = @"#"; // It is '@' by default

//These Will be initialized with Just alloc-init
_text_view.tableViewClass = [YourTableViewSubclass class];
_text_view.textFieldClass = [YourTextFieldSubclass class];

//REQUIRED
[_text_view makeTaggable];
[self.view addSubview:_text_view];

Data Source

You can give it all your tags like:

_text_view.tagSource = @[@"Deep Patel", @"whoever else"];

Or if you are pulling from an api you can subclass TaggableTextView and implement:

-(NSArray*) tagsForQuery: (NSString*) query;

The Tag event

-(void) didTagItemAt: (NSNumber*) i;

Make sure you implement this in your subclass. It gives you the index of the tagged element in tagSource

About

Customizable UITextView subclass that supports tagging.

Resources

Stars

Watchers

Forks

Packages

No packages published