watsonbox / ios_google_places_autocomplete

Google Places address entry for iOS (Swift)
MIT License
269 stars 72 forks source link

Closing the xib view #2

Closed Rogog closed 9 years ago

Rogog commented 9 years ago

Thank you for reading this post. Please note - I am new to programming.

I am having the following issue: http://stackoverflow.com/questions/28521605/having-issues-with-nib-from-ios-google-places-autocomplete

The xib file is loaded in a Viewcontroller under the ViewDidLoad method, I am attempting to get back to the parent ViewController, from which I came to the autocomplete ViewController. However, everytime I close the the autocomplete.xib view it reloads again because the ViewDidLoad tells it to do so in the example code kindly provided.

I don't understand how to:

  1. Click on the button so it redirects back to the parent view.
  2. Make a selection on the cell so it navigates the user to the parent view.

Again - my apologies if this is a basic question, as mentioned - I'm new to programming.

watsonbox commented 9 years ago
  1. To stop the autocomplete controller from loading every time the view loads, either remove it from viewDidLoad (and put it in a button click handler, for example), or if that's really where it belongs then perhaps use a variable stored property to store the currently selected Place and only show the autocomplete controller if none exists.
  2. placeSelected is the correct callback for handling selections. Perhaps you should dismiss the autocomplete view before performing the segue as you do in your close handler? Please link a Github project with this issue if you really can't get it working.
Rogog commented 9 years ago

Hi

Thank you for your reply

"...or if that's really where it belongs then perhaps use a variable stored property to store the currently selected Place and only show the autocomplete controller if none exists." - How will the user be able to edit the stored location once they have set it?

Regarding point 2, will do -

Once again, thank you for your help and future feedback.

watsonbox commented 9 years ago

I'm afraid I'm not sure exactly what you mean by edit the stored location. I suggest if you're still having problems that you share an example project and I'll do my best to point you in the right direction.