Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

How to subclass HMGLTransitionManager? #15

Open
zakdances opened this Issue Jul 18, 2012 · 2 comments

Comments

Projects
None yet
2 participants

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?

Owner

Split82 commented Jul 18, 2012

Why do you want to subclass HMGLTransitionManager? To create your own transition you should subclass HMGLTransition.

On 19.7.2012, at 0:47, zakdancesreply@reply.github.com wrote:

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?


Reply to this email directly or view it on GitHub:
#15

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