Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

How to subclass HMGLTransitionManager? #15

Open
zakdances opened this Issue · 2 comments

2 participants

@zakdances

How can I subclass HMGLTransitionManager? I'm attempting it now, but my override methods are not being called. Is there a recommended way to create a subclass? Do the source files need to be changed so that the superclass methods are declared in the .h?

@Split82
Owner
@zakdances

I want to subclass HMGLTransitionManager so I can choose my own "destination" view controller after dismissing a modal view controller.

For example, I have a modal view controller which is called from a view controller on a navigation controller stack. Then that same modal view controller calls its own modal view controller (so there are now 2 modal view controllers open and stacked on top of each other). When I dismiss the currently visible modal view controller, I want to return to the original view controller on the nav stack.

Here is a visual interpretation (VC stands for view controller):

VC A (on nav stack) -> VC B (modal) -> VC C (modal)

When I dismiss VC C, I want to return to VC A instead of VC B. I've found the only way to do this is to make some changes to HMGLTransitionManager's dismissModalViewController method. Specifically I've added this line:

self.currentController = modalViewController.presentingViewController.presentingViewController;

which works correctly, but I want to add it to a subclass instead of altering the source files directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.