Enterra Inc. Advances Development of Custom Camera iPhone applications

4431 iPhone applications for taking photos look really great. Thought what about using camera in native applications? What about creating a full-screen persistent "live"camera view? Intrigued to know how the application has been developed for you? Now Enterra Inc reveals its secrets with all of you! Get the idea of how it works! Have a look on the application from the inside.

Marvelous iPhone application

We developed a new application iUniqable. iUniqable allows you to send photos with notes to them from your iPhone to Facebook or Flickr. We developed it in such a way that it doesn't take you long to take a picture. You can upload a photo right after you have taken it! Moreover iUniqable has intuitively obvious navigation, translucent animated interface and outstanding graphics. Now follow the steps of how all this started.

The obstacles we had to tackle

iPhone SDK provides the capability of using camera through UIImagePickerController class. Usage of UIImagePickerController is feasible in the pop-up modal mode only. It also means that you have to reopen this view again to take the next picture. Moreover, the modal view contains additional panels and controls that overlay the camera view.

How we handled the issues

Nothing can be left unresolved. We knew from the start that we would find an elegant solution to the above problems. The idea that crossed our mind was the following: to use UIImagePickerController as an ordinal non-modal view controller under the navigation controller in the way we use the other view controllers. To get and save a photo we assigned a delegate and processed UIImagePickerControllerDelegate events. It was great up to the point that the Retake and Save buttons above the camera view didn't work when they were touchedÖ It seemed we needed to fully recreate the UIImagePickerController instance to take another photo. Actually, it wasn't that simple! Moreover we still were needed to use the panels and buttons that overlayed the camera viewÖ

We did it!

Finally, an awesome idea has crossed our mind! The solution was the following. When we touched the Shoot button, the view stoped refreshing. The single image from the camera was on display. Then we had to touch the Retake or Save button. Could we get the image and save it without using the UIImagePickerControllerDelegate? Could we touch the Retake button programmatically to reset the view and get another photo? We noticed that after touching the Shoot button there was a hidden view of ImageView type. Though the class hadn't been described in the SDK, we explored its methods using Objective-C capabilities. As a result we returned CGImage object and the image size was identical to the camera picture! We hid a number of views above the camera view and created our own button below the camera view to take the photo in one touch. We got the corresponding selector from the Shoot button and called it from our action handler. To hide the overlaying camera views and controls and to cr!
eate our own button, we hid them before they had been added to the camera view. It was realized using Objective-C capability. In this method we checked that the passed view was one of the camera view subviews and set its' "hidden" property to YES. So, we replaced the addSubview in the viewWillAppear before the camera view had been created. Additionally we created our toolbar and Shoot button in the viewDidAppear after the camera view had been created

You can get the examples of source code and get more tips on how we did it here:
http://techzone.enterra-inc.com/iphone/custom-camera-applications-development-using-iphone-sdk/

Feel free to visit the website of the developer:
http://www.enterra-inc.com




Tags: iPhone ď iPhone How To ď

Login † or † Register † †

Follow Us

Twitter Facebook RSS! http://www.joeryan.com Joe Ryan

Most Popular

iPod




iPhone

iLife

Reviews

Software Updates

Games

Hot Topics

Hosted by MacConnect - Macintosh Web Hosting and Mac Mini Colocation                                                    Contact | Advanced Search|