I want to pass my UIImageView that has a image loaded into it from clicking a button to a different UIImageView in a different ViewController.
Here is my code
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"MY_SEGUE"])
{
// Get reference to the destination view controller
ViewControllerName *vc = [segue destinationViewController];
// Pass the current UIImageView to a different UIImageView in a different view controller
[vc setUIImageView:UIImageView2];
}
}
So far when I run this nothing happens when I load the next view. I have no Errors. Do I need to say something in the – (void)viewDidLoad for this to work?
Any tips or suggestions???
Thanks
You need to do something with the image view in your destination view controller. You probably want to add the view to your view hierarchy. You might do it in
viewDidLoador inviewWillAppear:.