Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First release #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
33 changes: 30 additions & 3 deletions ACEAutocompleteBar/ACEAutocompleteBar.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/*
Jimmy Jose
Added :

- Extended support for UITextView
- Extended support for every word in the sentence
- Retain cursor position after selecting suggestion
- Removed the need for implementing delegates for input field
- Added ignoreCase option to ignore case of the input and suggestion list
- Added property separatorColor to customizeView
- Added dataSourceContent to do the matching internally [can be made smooth, probably in next update]
- Added support to hide suggestion list on single tap or if selection changed
- Added clearButton to dismiss the suggestion list
- a) Set custom image for clear button
- b) Disable clear button
- Added 'text' NSString object in textfield delegate for result manipulation
- Added 'range' UITextRange object in textfield delegate for cursor manipulation
- Added 'text' NSString object in textview delegate for result manipulation
- Added 'range' NSRange type in textview delegate for cursor manipulation

*/



#import <UIKit/UIKit.h>

Expand All @@ -34,10 +57,13 @@

#pragma mark -

@protocol ACEAutocompleteDelegate <UITextFieldDelegate>
@protocol ACEAutocompleteDelegate <UITextFieldDelegate,UITextViewDelegate>

@optional
// called when the user tap on one of the suggestions
- (void)textField:(UITextField *)textField didSelectObject:(id)object inInputView:(ACEAutocompleteInputView *)inputView;
- (void)textField:(UITextField *)textField didSelectObject:(id)object inInputView:(ACEAutocompleteInputView *)inputView newTextForInputField:(NSString *)text withRange:(UITextRange *)range;

- (void)textView:(UITextView *)textView didSelectObject:(id)object inInputView:(ACEAutocompleteInputView *)inputView newTextForInputField:(NSString *)text withRange:(NSRange)range;

@end

Expand All @@ -49,7 +75,7 @@
- (NSUInteger)minimumCharactersToTrigger:(ACEAutocompleteInputView *)inputView;

// use the block to return the array of items asynchronously based on the query string
- (void)inputView:(ACEAutocompleteInputView *)inputView itemsFor:(NSString *)query result:(void (^)(NSArray *items))resultBlock;
- (void)inputView:(ACEAutocompleteInputView *)inputView itemsFor:(NSString *)query ignoreCase:(BOOL)ignoreCase withResult:(NSArray *)resultArray result:(void (^)(NSArray *items))resultBlock;

@optional

Expand All @@ -66,5 +92,6 @@

#import "ACEAutocompleteInputView.h"
#import "UITextField+ACEAutocompleteBar.h"
#import "UITextView+ACEAutocompleteBar.h"


9 changes: 7 additions & 2 deletions ACEAutocompleteBar/ACEAutocompleteInputView.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@

#import <UIKit/UIKit.h>

@interface ACEAutocompleteInputView : UIView<UITextFieldDelegate>
@interface ACEAutocompleteInputView : UIView<UITextFieldDelegate,UITextViewDelegate>

@property (nonatomic, assign) UITextField *textField;
@property (nonatomic, assign) UITextView *textView;
@property (nonatomic, assign) BOOL ignoreCase;
@property (nonatomic, assign) NSArray *dataSourceContent;

// delegate
@property (nonatomic, assign) id<ACEAutocompleteDelegate> delegate;
@property (nonatomic, assign) id<ACEAutocompleteDataSource> dataSource;

// customization (ignored when the optional methods of the data source are implemeted)
@property (nonatomic, strong) UIFont * font;
@property (nonatomic, strong) UIFont * font;
@property (nonatomic, strong) UIColor * textColor;
@property (nonatomic, strong) UIColor * separatorColor;

- (id)initWithHeight:(CGFloat)height;
-(id)initWithClearButtonImage:(UIImage *)clearButtonImage andShouldShowClearButton:(BOOL)shouldShowClearButton;

- (void)show:(BOOL)show withAnimation:(BOOL)animated;

Expand Down
Loading