I have a uibutton inside a uiScrollview inside a uiviewcontroller. When I click the button I want to be able to call a method in the uiviewcontroller.
I have the following action on my button that calls a method within my uiscrollview:
[categoryButton addTarget:self action:@selector(categoryButtonWasClicked:) forControlEvents:UIControlEventTouchUpInside];
But this just calls a method within my uiscrollview (which I will still keep). How do I then call a method in the viewcontroller??
Thank you for any help you can provide.
enter code hereTry doing something like thisCreate a subclass of UIScrollView and add a delegate then assign your UIViewController as the delegate and implement the “buttonWasPress..” method in it.
Then from the categroryButtonWasClicked method in your uiScrollView:
in your viewController’s .h add the following