Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Overlay View Not going away #30

Open
lukegeiger opened this issue Jun 5, 2013 · 6 comments
Open

Overlay View Not going away #30

lukegeiger opened this issue Jun 5, 2013 · 6 comments

Comments

@lukegeiger
Copy link

You have to tap on the view you present the modal on to get rid of the overlay view...

@aleufms
Copy link

aleufms commented Jun 24, 2013

+1

@phildow
Copy link

phildow commented Jul 11, 2013

Confirmed. Programmatically dismissing the view via dismissPopupViewControllerWithanimationType: leaves the background.

I believe the problem is the use of self in the runtime calls for associative storage.

When you create a detail view controller that you want to show as a popup, you call presentPopupViewController on the currently visible view controller, which we'll call the parent.

However, I have a dismiss button in the detail popup view that calls a method on its view controller, and it is from here that I need to dismiss the popupview. So I call dismissPopupViewControllerWithanimationType with self now as the detail view controller.

This doesn't work because the context for self has changed between presentation and dismissal from the parent view controller to the detail view controller.

Consequently, I need to get a reference back to the parent view controller and call the dismiss method on that. This is unfortunate, because now my detail view controller is coupled to the parent.

@gabreho
Copy link

gabreho commented Sep 7, 2013

in case anyone still has this problem, i fixed it by replacing line 80 with this:
UIView *overlayView = [sourceView.superview viewWithTag:kMJOverlayViewTag];

@tybu
Copy link

tybu commented Apr 15, 2015

thanks @gabreho for this fix :-)

@thekevshow
Copy link

Thank you for the fix @gabreho, this should be implemented into the library

@rahul-apple
Copy link

Great work,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants