当方、カメラアプリの作成を行っております。
下図のようにTitle→MainMenu→A・B・Cの順に画面遷移させる構造です。
MainMenuからAへのUIImage(写真)を渡すことができましたが、
Aで加工したあとにMainMenuに戻る際の画像の渡し方、受け取り方がわからず、
入る予定であるImageViewが真っ白になっているのが現状です。
AppDelegateにてBOOLによって条件分岐をすればどうかな、と試行錯誤をしています。
・MainMenuの画像の受け取り方、Aの画像の渡し方
・MainMenuを再度表示させたとき、Aから戻ってきた場合、Bから戻ってきた場合などの条件分岐の方法
を教わりたいと思い、質問させていただきました。
なにとぞよろしくお願いいたします。
override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) //StoryBoardIDの選別ができたら素敵 if appDelegate.isNewEffectAdded == true { backImageView.image = effectedImage appDelegate.isNewEffectAdded = false } else if appDelegate.isNewStampAdded == true { let stamp = appDelegate.stampArray.last! stamp.frame = CGRectMake(0, 0, 150, 150) stamp.center = mainImageView.center stamp.userInteractionEnabled = true canvasView.addSubview(stamp) appDelegate.isNewStampAdded = false } }
<<A(Effect)>>
@IBAction func completionTapped() { //アラートの表示をさせたい effectImage = photoImageView.image let es = storyboard?.instantiateViewControllerWithIdentifier("Photo") as! PhotoViewController es.effectedImage = effectImage es.modalTransitionStyle = UIModalTransitionStyle.CoverVertical appDelegate.isNewEffectAdded = true self.dismissViewControllerAnimated(true, completion: nil) }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/14 02:16 編集