해당 헤더파일에


<UINavigationControllerDelegate, UIImagePickerControllerDelegate>


델리게이트 추가


ex) @interface MainViewController : UIViewController<UINavigationControllerDelegate, UIImagePickerControllerDelegate>


이런식으로 추가해주고..



UIImagePickerController *picker = [[UIImagePickerController alloc] init];

    

   picker.delegate = self;

   picker.allowsEditing = YES;

   picker.sourceType = UIImagePickerControllerSourceTypeCamera;

//    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

//    picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;


    [self presentViewController:picker animated:NO completion:nil];


picker 소스 타입에 맞춰서 실행됨


UIImagePickerControllerSourceTypeCamera - 카메라 실행
UIImagePickerControllerSourceTypePhotoLibrary - 갤러리 실행
UIImagePickerControllerSourceTypeSavedPhotosAlbum - 라이브러리 실행 ( Camera Roll )


PS.
만약 Custom 하고 싶다면..
카메라는 Toolbar
갤러리는 NavigationBar

후훗..
그렇군

Posted by Mooki
,