swift初心者です。
現在、画面のimageViewをタップするとカメラが起動し写真を取り、ボタンを押すと先程の画面に戻り、imageViewには取った写真が映るようにしたいと思っています。
var aaa = aPicture.imageというのが撮影した画像の取得のコードだとしてAViewControlerに書いたとします。
前の画面のimageViewに写真を渡したいのでBViewControllerにimageView.image = aaaと書くとエラーになります。(Use of unresolved identifier 'aaa')
このように違うViewControllerで宣言したものは違うViewControllerではつかえないのでしょうか。
またBでこのようにしてカメラを起動しています。
/// カメラ起動
private func exeStartCamera() {
LR.log(.info, className, .start, msg: "")
if !isCameraOn { exeSetupCamera() isCameraOn = true } else { ivLicense.image = nil let setting = AVCapturePhotoSettings() setting.flashMode = .auto setting.isAutoStillImageStabilizationEnabled = true setting.isHighResolutionPhotoEnabled = false myImageOutput?.capturePhoto(with: setting, delegate: self) isCameraOn = false }
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー