Created
March 6, 2014 04:50
-
-
Save ken0nek/9382866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // カメラを起動する | |
| -(IBAction)launchCamera{ | |
| // 画像の取得先をカメラに設定 | |
| UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; | |
| // カメラが使用可能かどうか判定する | |
| if ([UIImagePickerController isSourceTypeAvailable:sourceType]) { | |
| // UIImagePickerControllerを初期化・生成 | |
| UIImagePickerController *picker = [[UIImagePickerController alloc] init]; | |
| // 画像の取得先をカメラに設定 | |
| picker.sourceType = sourceType; | |
| // デリゲートを設定 | |
| picker.delegate = self; | |
| // // 画像取得後に編集するかどうか(デフォルトはNO) | |
| // picker.allowsEditing = YES; | |
| // 撮影画面をモーダルビューとして表示する | |
| [self presentViewController:picker animated:YES completion:nil]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment