0
votes

I have created a custom uiscrollview and want an action on the uiscrollview to trigger a segue. I realise that all controls that trigger a segue have a "triggered segues" section in their connections inspector.

- (IBAction)startSegue....

In the .h file fits under the "Received Actions" section, is there a way to programmatically create a connection under the "triggered segues" connection to enable a custom class control to act as a connection for a segue?

Thanks D

2

2 Answers

0
votes

No, you can't do what you're suggesting. You need to make segue from the view controller, and call performSegueWithIdentifier:sender: inside one of the scroll view's delegate methods.

0
votes

You can trigger a segue programatically if that is what you're asking. Create a method which is called after from action (a button or motion on the UIScrollView) and call a method similar to this: (Taken from Creating a segue programmatically)

-(void) someMethod{
MyNewViewController *myNewVC = [[MyNewViewController alloc] init];

// do any setup you need for myNewVC

[self presentModalViewController:myNewVC animated:YES];
}