i am using a third parties View controller that needs to be initialised.
I am currently launching it programtically througbh a modal. It requires you pass it a UIImage to initiated the controller.
Currrently i am doing as follows
let thirdPartyVC = ThirdPartyViewController(image: myUIImage)
present(photoEditViewController, animated: true, completion: nil)
What i would like to do to do this with segues instead but i cant seem to work out how to initialise the controller with the image.
Currently i am trying to make a ThirdPartyViewController in the storyboard.
i am then performing a segue to it and trying to set the image in prepare for segue as follows bellow.
override func viewDidLoad() {
super.viewDidLoad()
operformSegue(withIdentifier: "segueToThirdPartyVc", sender: Any?)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
switch segue.identifier! {
case "segueToThirdPartyVc" :
let destination = segue.destination as? ThirdPartyViewControllerInstance
destination.image = aUIIMage
default:
break
}
Unfortunatly this is failing to initalise the controller. How do i sucessfuly init the controller.