I want to push UIViewController from UIView.
I have searched for that and i got link1, link2 but still I don’t getting what changes I need to do. !
My Code is as following
KalGridView.h
@interface KalGridView : UIView
{
}
KalGridView.m
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
// From here I want to push viewController.
}
How can I do This?
Usually you can access to
UINavigationControllervia appDelegate.So if you have the
UINavigationControllerproperty in yourappDelegate try this code:
animated:YES];
Implement a delegate in your custom view:
KalGridView.m
So now you can handle this event in any place where is your custom
view.
Use NSNotification:
In any point of your code:
And method for handle (likely in other viewcontroller)