I have following view hierarchy: navigation controller, inside it I pushed another view controller which contains UITableView with custom UIButtons in the cells. I have another view controller (MyCustomViewController2), which I want to show above all this stuff with animation.
But I am confused with this hierarchy and I don't know how to overwrite - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
method in my custom UIButton class. The code that I've come so far is:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
MyCustomViewController2 *myVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"MyVC"];
[self.window addSubview: myVC.view];
}
But it's so bad! And I don't have any animations and I should delete it to remove. What can I try next?