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

Support interactions on presenting view #76

Merged
merged 8 commits into from Oct 27, 2018

Conversation

ilyapuchka
Copy link
Contributor

Currently the presented view is not responding to touches when drawer view is presented because it appears behind UITransitionView added by UIKit, which intercepts all the touches.
One option to allow interactions of presented view could be to add its view as subview of transitionContext.containerView but that will make it to collide with tap recogniser and can result to unexpected behaviour when dismissing drawer with tap (if drawer is attempted to be presented twice then after it is dismissed UIKit does not call presentation controller methods)
Instead we put container view inside a subclass of UIView that implements hitTest and delegates it to presentation controller to decide what view, presented or container view should receive touches.
The gif shows that the view on background is accessible in partial expanded state but not in full screen, which can be configured.

20181024233738

Copy link
Contributor

@wltrup wltrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I only have one question and a nit, otherwise... 💯!

@@ -79,6 +79,35 @@ class DrawerKitDemoUITests: XCTestCase {
XCTAssertFalse(isDrawerOpen())
XCTAssertFalse(isDrawerFullyOpen())
}

func testTouchesPassthrough() {
let mainCanvase = app.buttons[Identifiers.mainCanvas]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canvas not Canvase :)

wltrup
wltrup previously approved these changes Oct 25, 2018
@wltrup wltrup dismissed their stale review October 25, 2018 14:40

Will use github's suggestion feature

wltrup and others added 2 commits October 25, 2018 15:47
…swift

Co-Authored-By: ilyapuchka <ilyapuchka@gmail.com>
…swift

Co-Authored-By: ilyapuchka <ilyapuchka@gmail.com>
wltrup
wltrup previously requested changes Oct 25, 2018
Copy link
Contributor

@wltrup wltrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... there are conflicts, so I'll wait until you fix those before approving.

@ilyapuchka ilyapuchka dismissed wltrup’s stale review October 25, 2018 15:11

conflict resolved

wltrup
wltrup previously approved these changes Oct 26, 2018
@wltrup
Copy link
Contributor

wltrup commented Oct 26, 2018

I've approved, under the assumption that you'll fix the broken tests.

wltrup
wltrup previously approved these changes Oct 26, 2018
@ilyapuchka ilyapuchka force-pushed the interactive-presenting-view branch 5 times, most recently from dba0c85 to 77744ea Compare October 26, 2018 20:39
@ilyapuchka ilyapuchka force-pushed the interactive-presenting-view branch 11 times, most recently from 619064f to 2245929 Compare October 26, 2018 23:55
@ilyapuchka
Copy link
Contributor Author

ilyapuchka commented Oct 27, 2018

@wltrup you need to approve this again I have admin rights to merge

@ilyapuchka ilyapuchka merged commit c880000 into master Oct 27, 2018
@ilyapuchka ilyapuchka deleted the interactive-presenting-view branch October 27, 2018 00:04
@ilyapuchka ilyapuchka changed the title Support interactions on presented view Support interactions on presenting view Oct 30, 2018
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.

None yet

2 participants