0

So I'm in the midst of updating my Web Browser app for iOS devices, from the ground up, and I'm trying to implement some more convenient features. One feature that seems to be really popular now, that I have been getting a lot of requests for, is the combination of a Google Search bar and a URL bar in one, like that of the Chrome application. Below is a screenshot of the Google Chrome app, and as you can see, they've made it so you can either enter in a search query like "apple ipad" and it will return a Google search page of 'Apple iPad', or you can enter in a URL "http://apple.com/ipad/" and it will load that URL.

Google Chrome on iOS

I have looked all over the internet, but all I could find were tutorials on how to Search Google with value of the UITextField. I have a feeling that the best way to do this is to probably make a 'check'. Like if the entered value contains 'http://' 'www.' '.com' or no spaces, then load it as a URL, if not then load it in a Google Search page, and then have the webview load up the Google Search page.

If anybody could show me to the right direction, that would be great, or even supplying me with some code would be even greater. :)

Thanks! If anyone needs part of the code, just ask.

JDev
  • 5,168
  • 6
  • 40
  • 61
  • I'm working on a class that i will be releasing to github that will do all of what you are talking about, should take me like a day if it's not up by the end of tonight, ill post it here as an answer when it's done. – Kris Gellci Dec 03 '12 at 01:12

1 Answers1

2

I have quickly coded up a class and uploaded it to my github account that you can use which is located HERE

I have also made a quick video on how to use this class which can be seen HERE

Hope this helps.

Kris Gellci
  • 9,539
  • 6
  • 40
  • 47
  • Thank you very much. :) Will try this out in the morning and give you some feedback! – JDev Dec 03 '12 at 05:17