Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dismiss function public #72

Closed
phillebaba opened this issue Sep 15, 2015 · 4 comments
Closed

Dismiss function public #72

phillebaba opened this issue Sep 15, 2015 · 4 comments

Comments

@phillebaba
Copy link

It would be great if we could make the dismiss function public to that the viewcontroller can be removed through custom logic. An option would be to access the done button method.

- (void)doneButtonTapped:(id)sender {
    self.transitionController.forcesNonInteractiveDismissal = YES;
    [self setOverlayViewHidden:YES animated:NO];
    [self dismissAnimated:YES];
}
lpenaflor added a commit to abodo-dev/NYTPhotoViewer that referenced this issue Dec 4, 2015
lpenaflor added a commit to abodo-dev/NYTPhotoViewer that referenced this issue Dec 4, 2015
@livings124
Copy link
Contributor

Having dismiss function public, with an animation completion block would be very useful. I've hacked together a solution where we pull the dismiss method from the dismiss button, but that's clearly not the best solution.

@jaybowang
Copy link

For uses who are not familiar with the swipe-up/down-to-dismiss-gesture it's a little confusing.
I watched two of my friends who haven't used this before and they both didn't know what to do for seconds. It would be better to add a close bar button item at the upper-left corner. Just like a close button in a normal modal view controller which people know for a long time.

I agree with @phillebaba and @livings124 .Want dismissAnimated: too.

Currently I'm using swift code photoViewer.performSelector(Selector("dismissAnimated:"), withObject: true) but no animation.

@cdzombak
Copy link
Contributor

cdzombak commented Jan 4, 2016

…It would be better to add a close bar button item at the upper-left corner.…

There is supposed to be one but it's broken on develop right now; see issue #102 .

I agree with @phillebaba and @livings124 .Want dismissAnimated: too.

Re: this proposal and the PR #96 , I've been holding off exposing dismissAnimated: because we believe the correct approach is to make the standard UIViewController method -dismissViewControllerAnimated:completion: work properly. Clearly it doesn't right now, but we believe it should; introducing a view controller which requires calling a custom method for dismissal feels wrong & breaks inheritance.

I haven't had time to dig into this to see what's required to make this work, but I would prefer making -dismissViewControllerAnimated:completion: work properly before we consider exposing the existing internal -dismissAnimated: method.

@cdzombak
Copy link
Contributor

cdzombak commented Jan 4, 2016

Please see #109 for further discussion.

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

No branches or pull requests

4 participants