カメラから写真を撮り、ライブラリから写真を選択するための実装を1つ作成しています。
ライブラリから写真を撮るには、ELCImagePickerController を使用し、スクロールビューで画像を設定しています。
私がやりたいのは、カメラからいくつかの画像を取得し、これを同じスクロール ビューに設定することです。
現在の私の実装は次のとおりです。
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *cameraPicker = [[UIImagePickerController alloc] init];
cameraPicker.delegate = self;
cameraPicker.allowsEditing = YES;
cameraPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:cameraPicker animated:YES completion:NULL];
}
- (void)imagePickerController:(UIImagePickerController *)photoPicker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[photoPicker dismissViewControllerAnimated:YES completion:NULL];
UIImage *image=[info objectForKey:UIImagePickerControllerEditedImage];
UIImageView *imageview = [[UIImageView alloc] initWithImage:image];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
[self.scrollView addSubview:imageview];
[self dismissModalViewControllerAnimated:YES];
}
これを使用すると、一度に1枚の写真を撮ることができ、これを再度設定すると、他の写真が置き換えられます。どうすればサーバルを摂取できますか? そして、私はそれをどのように行うと思いますか?