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

Implement shouldTransition(for scrollView: UIScrollView?) delegate method #105

Conversation

brandonscript
Copy link

I had a need to be able to govern from the presented view controller whether or not a particular scroll view should respond and interactively dismiss the controller. This was driven from a need to handle a re-orderable table view, and the long-press/drag gesture was being intercepted, and closing the view.

Simple implementation of this delegate, for example in my case, I needed to block the transition if my tableView is editing:

extension ModalViewController: DeckTransitionViewControllerProtocol {
    func shouldTransition(for scrollView: UIScrollView?) -> Bool {
        return !editHistoryTableView.isReordering // returns true if the table view is not editing
    }
}

@HarshilShah
Copy link
Owner

Hey there, thank you for this PR, and sorry for the late response.

I’m working on an update to the library which makes a whole range of changes, one of which will be the ability to selectively enable/disable dismissal. You can read more about it on #109. Since the implementation is going to be a bit different there and more generic, closer to the way Apple’s done it, I’m going to close this PR.

@HarshilShah HarshilShah closed this Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants