I have a StoryBoard and a base ViewController include some images.
How I can touch an image of them to go to other ViewController linked that UIImageView by modal?
create the new viewController
drag a tap gesture recognizer to the first viewController
right click + drag from the gesture recognizer to the new viewController and you will see the option modal
right click + drag from the UIImageView to the gestureRecognizer and you will see the gestureRecognizer option select it and that's all
Make sure the UIImageView have the "User Iteraction Enabled" option ckecked
just added a sample project to my github
You can try the following to move from one view controller to another:
[MyImageView.view removeFromSuperview];
[MyNewViewController.view addSubview:MyImageView.view];
If you wish to animate that change making it fly its way, you might need to create animation for MyImageView.view.frame from the old to the new view controller. For that you'll need to use methods like
CGRect fromFrame = [MyImageView.view convertRect:MyImageView.view.frame toView:MyOldViewController]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With