GMSAutocompleteViewController want to get text which is in searchbar on search click - ios

Hi i have used GMSAutocompleteViewController full-screen control.
https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control
i am not able to get keyboard search click event tried by searchbar event and textfieldshouldreturn event but it is not called. i want to get text which i have typed when any location not found in google.

From the Google Places API documentation..
https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control
Use a results controller when you want more control over the text input UI
You can not access search bar if you are using GMSAutocompleteViewController. You have to use GMSAutocompleteResultsViewController.

Make sure you have put your provideAPIKey.

try removing restriction of the api from the console
https://console.cloud.google.com/apis/credentials?project=.
it helped me.
thnx

Related

iOS Custom keyboard - Not able to move focus to and fro between custom keyboard's search field and the third party app’s search field

We are designing a custom keyboard on iOS with a TextField (Search Field) on it.
Problem - Not able to move the focus to and fro between our custom keyboard's search field and the third party app’s search field.
when the focus comes to the custom keyboard search field it never goes back to the Parent App's search field.
PS: I have seen the keyboard apps like Popkey and Fleksy successfully doing this.
I could find out a workaround to achieve required functionality by keeping a Label instead of textField. With this work around we don't have to worry about the focus issue. Once user starts typing, we need to catch the event and update the text in label.
Hope this will help if some one is still looking for a solution to this problem.

How can I add selectable suggestion on textfield

I'm not sure if I use the phrase correctly.
The function I want is that after user typed some characters (or clicked a button), a list will be shown under the textfield.
An easy example is Google search. After you typed "fb" or "faceb", it shows "facebook" in the suggestion list.
The content of the list is stored in an array, which comes from the return of web services.
Thanks
You've got to intercept the keystrokes with UITextView textViewDidChange. Then, with each keystroke, you implement the lookup algorithm and display your list of selections above or below the UITextView where the data entry is occurring. The list has to somehow be "touchable" to select from it.
Ray Wenderlich has a tutorial that shows how this can be done over at his blog
He creates a table below the text field that is touchable.
There is also a sample project there.

Windows Phone Application Bar TextBox

I was wondering, if it is somehow possible to add a TextBox in the Application Bar area (the same way the Internet Explorer does), but I didn't find any information source about this. Have you any idea, how to accomplish this task?
You will not be able to add UIElements inside ApplicationBar as it is not derived from UIElement.
Alternatively, you can try adding a Grid at the bottom of the screen and color it similar to the ApplicationBar. Then add a TextBlock inside the Grid. This is just a workaround and not recommended as it is not according to the standards.
You can also check the following link:
http://www.maxpaulousky.com/blog/archive/2011/01/10/bindable-application-bar-extensions-for-windows-phone-7.aspx

Adding actions for selected text

Is it possible to add actions, like Highlight or sending a Tweet, to the popup that appears when you select some text from a UIWebView?
Edit: If not, is it possible to obtain the selected text through another way?
Inject it via javascript, then send the location or href to something like "myaction://handleIt" and get it on the shouldLoad.

Customize 'Copy' text popup (UIWebView)?

I'm trying to customize the user text selection behavior in a
UIWebView. Currently, when a user highlights a region of text in a
UIWebView the 'Copy' action sheet appears, allowing you to copy the
text. I would like to perform some custom action on text selection,
effectively replacing the 'Copy' dialog, or adding another option to
the list of options (e.g. 'Copy' | 'Search').
My question is: Is there any Apple-accepted way of doing this? I'd
prefer not to put my app approval in jeopardy, so doing this by the
book is ideal. I've seen similar questions asked about this topic, but
all remain unanswered. Can anyone provide some insight on how to
accomplish this?
The popup you refer to is called a UIMenuController. You can access the [UIMenuController sharedMenuController] method to get the menu controller. You can then add your own UIMenuItems to the menu controller, and these can be shown contextually, using the canPerformAction:withSender: method on the UIWebView. For more info, refer to the iOS Developer Reference on UIMenuController

Resources