1

how to open camera by clicking tab in tab bar application and i want to also custom that camera controller? i have seen many apps that do like this and they have extra functionalities also like instagram this is also used like this pinterest this is another picplz i have googled some links but i didn't get the perfect result i have tried to put open camera via - (void)viewWillAppear:(BOOL)animated but it is not working perfect can any body can guide me to create camera view like above some applications?

i have seen this apple example. for custom view of camera i have seen this.

hey anybody have any answers?

Community
  • 1
  • 1
Hrushikesh Betai
  • 2,177
  • 5
  • 30
  • 63
  • hello!! I am just trying to do the same but I didn't find any clear documentation, did you solve it at the end??, thanks!!!! – TurboManolo Aug 08 '12 at 12:24
  • 1
    @TurboManolo yeah i got solution from my app requirement i have to just make my own camera from `AVCaptureSessionManager` here is link. https://github.com/jj0b/AROverlayImageCapture if i helped you than plz voteup my question. – Hrushikesh Betai Aug 08 '12 at 14:43

2 Answers2

-1

Try this code snippet.

UIImagePickerController *picker = [[UIImagePickerController alloc] init]; 
picker.delegate = self; 
picker.allowsEditing = YES;
if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])) 
{
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentModalViewController: picker animated:YES]; 
}
else
{
        // Put alert no camer found
}
[picker release];
Naveen Thunga
  • 3,667
  • 2
  • 22
  • 31
  • 1
    hey have you read my question perfectly what i exactly want is that when i click on tabbar button it should open directly camera controller not `UIACtionSheet` pls read my question perfectly see exaple links i have given. – Hrushikesh Betai May 15 '12 at 05:44
  • Sorry... read this http://stackoverflow.com/questions/4812945/opening-camera-in-iphone-app-programatically – Naveen Thunga May 15 '12 at 05:48
  • @Hrushikesh : Hey did try this dude? :P Please try this in device i.e. iPod 2nd generation.(camera enabled). Please test the code properly then only downvote the answer. – Naveen Thunga May 15 '12 at 06:32
  • i have already tried like this your above code but have you seen the links which i have provided they directly open custom camera on click of tabbar button pls see this app's they are absolutely free. – Hrushikesh Betai May 15 '12 at 06:41
-5
- (IBAction)buttonTap:(id)sender
{
    UIActionSheet * theActionSheet;

    if(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        theActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:NSLocalizedString(@"Choose existing photo", nil) otherButtonTitles:nil, nil, nil];
        self.actionSheet = theActionSheet;
    }
    else
     {
         theActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:NSLocalizedString(@"Take photo", nil) otherButtonTitles:NSLocalizedString(@"Choose existing photo", nil), nil, nil];
         self.actionSheet = theActionSheet;
     }
     self.actionSheet.tag = 100;
     self.actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
     [self.actionSheet showInView:self.view.window];    // show from our table view (pops up in the middle of the table)
     [theActionSheet release];      
}
The iOSDev
  • 5,048
  • 7
  • 39
  • 74
  • 1
    hey this is the same copy/past of the answer given before you. avoid this type of errors please – The iOSDev May 15 '12 at 05:41
  • @user1395270 hey have you read my question perfectly what i exactly want is that when i click on tabbar button it should open directly camera controller not `UIACtionSheet` pls read my question perfectly see exaple links i have given. – Hrushikesh Betai May 15 '12 at 05:44