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
Conversation
f98d008
to
bd8cf71
Compare
bd8cf71
to
92b5013
Compare
There was a problem hiding this 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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canvas
not Canvase
:)
DrawerKit/DrawerKit/Internal API/PresentationController+Setup.swift
Outdated
Show resolved
Hide resolved
DrawerKit/DrawerKit/Internal API/PresentationController+Setup.swift
Outdated
Show resolved
Hide resolved
…swift Co-Authored-By: ilyapuchka <ilyapuchka@gmail.com>
…swift Co-Authored-By: ilyapuchka <ilyapuchka@gmail.com>
There was a problem hiding this 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.
2fd88f1
to
dd20c07
Compare
I've approved, under the assumption that you'll fix the broken tests. |
dba0c85
to
77744ea
Compare
619064f
to
2245929
Compare
2245929
to
52de547
Compare
|
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 implementshitTest
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.