forked from freak4pc/SMTagField
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SMTagFieldDelegate.h
54 lines (41 loc) · 1.3 KB
/
SMTagFieldDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// SMTagFieldDelegate.h
//
// Created by Shai Mishali on 6/16/13.
// Copyright (c) 2013 Shai Mishali. All rights reserved.
//
#import <Foundation/Foundation.h>
@class SMTagField;
@protocol SMTagFieldDelegate <NSObject>
@optional
/**
Called by delegate when a specific tag was added
@param tagField The Tag Field
@param tag The tag
*/
-(void) tagField: (SMTagField *) tagField tagAdded: (NSString *) tag;
/**
Called by delegate when a specific tag was removed
@param tagField The Tag Field
@param tag The tag
*/
-(void) tagField: (SMTagField *) tagField tagRemoved: (NSString *) tag;
/**
Called by delegate when any change to the tags occured (add/remove)
@param tagField The Tag Field
@param tag The tag
*/
-(void) tagField: (SMTagField *) tagField tagsChanged: (NSArray *) tags;
/**
Tells SMTagField whether or not it should add a new tag. This could be used to limit the number of tags or blacklist bad words, etc...
Defaults to YES if protocol isn't implemented.
*/
-(BOOL) tagField: (SMTagField *) tagField shouldAddTag: (NSString *) tag;
/**
Provides a list of autocomplete tags to SMTagField.
@param tagField The tagField
@param text The text just entered
@return array of tags
*/
-(NSArray *)tagField: (SMTagField *)tagField autoCompleteTagsForTextEntered:(NSString *)text;
@end