質問失礼します。
カメラで撮影後に画面遷移する事は成功したのですが、
現状のコードですとpicker.dismissで一度元の画面に戻ってからの遷移となってしまいます。
picker.dismissを消すとエラーで画面遷移が出来ないので仕方のない事かとも思うのですが、
初学者なのでそういった方法が本当にないのかも分からずにモヤモヤしています。
もし私が勉強不足なだけでそういった方法がありましたらご教示いただけますと嬉しいです。
よろしくお願い致します。
swift
1 //撮影後の処理 2 func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { 3 4 if let pickedImage = info[.editedImage] as? UIImage { 5 6 //pickerを閉じる 7 picker.dismiss(animated: true, completion: nil) 8 //ストーリーボードIDを使用して次の画面へ遷移する 9 let fromCameraVC = self.storyboard?.instantiateViewController(withIdentifier: "fromCamera") as! FromCameraViewController 10 fromCameraVC.modalPresentationStyle = .fullScreen 11 self.present(fromCameraVC, animated: true, completion: nil) 12 13 } 14 }
回答1件
あなたの回答
tips
プレビュー