Closed ivnsch closed 7 years ago
Hey @i-schuetz,
at the moment, this is not possible. I agree, though, that this might be a desired behavior. Feel free to do a PR on this, I do not have any approach in mind at the moment, tbh.
Thanks!
Hey. I ended modifying an own custom popup, so I'll probably not do this. Feel free to close, if you want!
Commenting out lines: // if interactor.hasStarted || interactor.shouldFinish { // return DismissInteractiveTransition() // }
in "PopupDialog/Classes/PresentationManager.swift" Fixed the PanGestureDismiss direction for me.
Also conversting 👍 let translation = sender.translation(in: vc.view) let verticalMovement = translation.y / vc.view.bounds.height let downwardMovement = fmaxf(Float(verticalMovement), 0.0) let downwardMovementPercent = fminf(downwardMovement, 1.0)
to let translation = sender.translation(in: vc.view) let verticalMovement = (-translation.y) / vc.view.bounds.height let downwardMovement = fmaxf(Float(verticalMovement), 0.0) let downwardMovementPercent = fminf(downwardMovement, 1.0)
I was looking for a way to be able to dismiss the (same) popup to top as well as bottom. A possible way to implement this would be to create a delegate for
InteractiveTransition
, which would be implemented byPresentationManager
, in order to be notified if the current direction is to the top or to the bottom, so it can return aDismissInteractiveTransition
with the respective direction. This would also require thatvc.dismiss(animated: true, completion: nil)
, inInteractiveTransition
would be called in.changed
and not in.began
like it's now, since it's necessary to get the first delta to determine the direction.Questions: Is there interest for this feature? If yes, is this the correct way to implement it or is there maybe a better one?