Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to subclass HMGLTransitionManager? #15

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

How to subclass HMGLTransitionManager? #15

zakdances opened this issue Jul 18, 2012 · 2 comments

Comments

@zakdances
Copy link

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
Copy link
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

@zakdances
Copy link
Author

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants