Welcome to the Treehouse Community
Looking to learn something new?
QR Code Application Advice
I am trying to create an iphone application that is similar to RedLaser. I was wondering if someone could give me advice on how you would create the UI when the barcode has been scanned.
The following image shows what happens when you scan the Nutrigrain barcode. It shows the image, title, and there are even buttons to add to favourites and a list all information is contained within the application and not sent to the safari app:
I like the way how it is all contained within the application and I would like to do something like this. I'm pretty stuck on understanding how to tell the application what to do once a code has been scanned instead of opening straight to safari like a normal website, and how to code the UI to do this
Patrick Cooney12,216 Points
There shouldn't be a "default" action. You can tell it what to do once it receives the bar code info. To show it in-app you'd probably have to have a database with an API that could pull information from the DB without needing to go to a webpage. You can then use the returned JSON or (XML) to populate the information of your app in your view controller. This is all assuming when you say you don't want it to open Safari you mean you don't even want to use a webview (which is like safari only on the area of the screen you tell it to occupy.).
With your advice, I managed to get this all up and running with JSON and sending it through to the app I designed.