Hello,
Trying to create a transition from one view controller to another, I’ve created a Segue. It’s working, however if I want to pass some data to new ViewController:
@Override
public void prepareForSegueSender(UIStoryboardSegue segue, @Mapped(ObjCObjectMapper.class) Object sender) {
super.prepareForSegueSender(segue, sender);
if (segue.identifier().equals("second_view_segue")) {
SecondViewController secondViewController = (SecondViewController) segue.destinationViewController();
secondViewController.title().setText("Title");
}
}
Unfortunately I get an error:
Terminating app due to uncaught exception 'java.lang.ClassCastException', reason: 'java.lang.ClassCastException: apple.uikit.UIViewController cannot be cast to com.myCompany.ios.ui.SecondViewController
I would be grateful for any advice.