GithubHelp home page GithubHelp logo

troshko111 / trautocompleteview Goto Github PK

View Code? Open in Web Editor NEW
192.0 192.0 63.0 892 KB

Autocomplete view attachable to any UITextField. Ships with sample items source - google places items source. Can be configured to autocomplete from any source. Auto fits all available space, customizable look and feel

License: Other

Ruby 1.12% Objective-C 98.88%

trautocompleteview's People

Contributors

aniketawati avatar bartekhugo avatar batjo avatar dmitry-zaitsev avatar readmecritic avatar simone-moku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trautocompleteview's Issues

AutocompleteView position is wrong when using navigation bar.

The problem is view location is computed in window coordinates instead of ViewController's coordinates.
AutocompleteView should be added to window or, coordinates should be converted to ViewController's coordinate system:

TRAutocompleteView.m, line 136:

CGPoint textPosition = [_queryTextField convertPoint:_queryTextField.bounds.origin toView:_contextController.view];

didAutocompleteWith is not called

Hello

The issue is that didAutocompleteWith is not called. When I debugged the app, I also noticed that didSelectRowAtIndexPath in TRAutocompleteView code is not called either. Then I noticed that it gets called when I press the table view cell longer. I investigated this issue on the web, and mostly this kind of problem occurs when someone has gesture recogniser which steals the touch event from table view. In my case I do not have any gesture recogniser. So I'm completely puzzled what can cause this kind of issue. Any suggestions? Thanks for help.

Regards
Gagik

Table separator style and colour cannot be modified.

These properties are set only in the "initWithFrame:textfield:itemsource:cellfactory:controller" method which calls "loadDefaults" in the beginning which removes the separator.

One solution could be to implement setters for these properties and set the values to the table view.

Result view not showing

I have a little issue with TRAutocompleteView.

Here is my code af a simple UIvewController with a mapview :

  • (void)viewDidLoad
    {
    [super viewDidLoad];

    // Do any additional setup after loading the view from its nib.

    mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

    mapView.showsUserLocation = true;
    mapView.mapType = MKMapTypeStandard;
    mapView.delegate = self;

    //[self.view addSubview:mapView];
    

    _autocompleteView = [TRAutocompleteView autocompleteViewBindedTo:labelSearch
    usingSource:[[TRGoogleMapsAutocompleteItemsSource alloc] initWithMinimumCharactersToTrigger:2 apiKey:@"AIzaSyDPPy3-dil-xZ5E5H2xMrWPYk62iL3qR4I"]
    cellFactory:[[TRGoogleMapsAutocompletionCellFactory alloc] initWithCellForegroundColor:[UIColor lightGrayColor] fontSize:14]
    presentingIn:self];

    _autocompleteView.didAutocompleteWith = ^(id item)
    {
    NSLog(@"Autocompleted with: %@", item.completionText);
    };
    }

The search is doing well but the result view is not displayed. I think it's under my map view but I don't understand why.

Any help ?

cellForRowAtIndexPath in TRAutocompleteView is not called for any number of rows.

I downloaded this library a week ago and used it for places search. It worked fine for 4,5 days but now when i search any place, i get the response from Google places API (i saw them in logs). self.suggestions.count returns more then one row in numberOfRowsInSection method, but cellForRowAtIndexPath method does not get called. So I cant see anything in tableview as search results returned by google places API. Please help.

Custom source examples

Hi there,

Can you please put a simple example of how to use a custom source and a custom cell factory? The source could be a simple array of 3 or 4 string objects.

Also, when there are more than one text fields in a single view, does the suggestion table align it self to the text field user is typing in? And suggests auto-complete words unique to that field?

Thanks heaps.

How to implement "didAutocompleteWith" property in swift

I have tried to implement the autocompleteview in my swift project by using bridge headers. But i am not able to figure out how to implement the _autocompleteView.didAutocompleteWith property as in objective c the above property uses
_autocompleteView.didAutocompleteWith = ^(id item)
{
NSLog(@"Autocompleted with: %@", item.completionText);
};

not able to figure out how to implement above property in swift.

Remove AFNetworking dependency

Hey, thanks for making this!
Alas, I can't use it as a Cocoapod because we use AFNetworking 2. I'm currently extracting the core files instead. Have you considered separating the network code out, or using NSURLSession instead?

Autocomplete Options Not Showing Up

I cloned the file and have it building and running, my google places API key is definitely being hit and going through shown by google, but when I go to type in a place, no autocomplete options come up.

Is there something I should change or that I am missing? I haven't changed any part of the code from what I have cloned from the repo except for inputing my API key where it says @"INSERT_YOUR_PLACES_API_KEY_HERE". I am getting a response from the API with the list of predictions, however are not getting sent to the UI.

screen shot 2015-07-14 at 9 55 36 am

Compile error

I can't compiled it. I've added AFNetworking as well but it won't work.
What am I missing?
screen shot 2015-04-03 at 12 57 49 pm

two UITextField problems

Hi,
Thanks for this great module. It works like a charm .

Now, I am trying to implement two UITextFields .First one for keyword and the seoncd one for location. When the page loaded .The keyword textfield become firstResponder automatically. The autocompletion for first text field does not have any problem.

But the problem is with the second textfield. When user click to change from first textfield to another .It seems like the NSNotification for the first one is still in place and the "UIKeyboardDidShowNotification" will not get notice in the second textfield.

I tried to solve this problem by use textFieldDelegate in the controller . When the location Textfield get tapped , the "- textFieldShouldBeginEditing " get called. And I specifically ask the first textfield to resignFromFirstResonponder. This seems to work .But the behavior is not so smooth .Because when resignFromFirstResonponder get called. The keyboard is removed from screen and user can't enter the editing mode of the location textField instantly. User has to tap twice to enter location.

Are there any solution for this ?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.