Closed lkuraer closed 9 months ago
Hi @lkuraer, thanks for reporting this. When I find some time I'll take a look at it. PRs are always welcome 😄
@lkuraer May you please share your code with us to reproduce the issue? I made a demo app with the following code and works as expected:
class ViewController: UIViewController {
var toast: Toast!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.view.backgroundColor = .gray
self.toast = Toast.text("Safari pasted from Noted", config: .init(direction: .bottom, enablePanToClose: true))
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.toast.show()
}
}
}
Thank for your response , @Nikoloutsos , I beleive, you should try on real device. Actually there are two problems, please check attached screencast:
code is the same:
the first problem, is that app tries to hide when try to drag toast, that's why I think you should add this to config which swap direction to add (from bottom to top and vice-verse).
and the second problem is the same as in opened issue https://github.com/BastiaanJansen/toast-swift/issues/18
when try to pan to remove - library broke and toast can't be removed at all.
The app hides because Reachability is enabled. I guess Reachability is by default disabled, so it works as expected on the simulator. Maybe disable Reachability on your phone (or enable in the simulator) to definitely say that is the problem?
@Nikoloutsos is already looking into #18 :).
@BastiaanJansen you are right, when disable Reachability in settings, pan works. But I think there is a good variant to add swipe direction for remove, what do you think?
I agree
@lkuraer @BastiaanJansen
Just to make things clear because I am a little confused.
At this moment, as shown in the ☝️ video, when developer uses the direction of bottom
he has to drag from top-to-bottom in order to dismiss. And vice versa when direction of top
is used he has to drag from bottom-to-top in order to dismiss.
I think this is the intuitive behaviour of how the panToDismiss works.
So what you're suggesting is to give the ability to select either top-to-bottom
or bottom-to-top
pag gesture despite the toast direction? 🤔
Absolutely correct
@Nikoloutsos have you had a time to look into this? Also, the problem with enabling autohide + swipe to remove has come back. Toast does not disappear if try to swipe.
@lkuraer At this moment I don't have much free time to look into it.
@lkuraer the autohide + swipe bug should be resolved now.
@BastiaanJansen it works now, thanks! But the main issue is still exist. Selecting toast appear at top + swipe to close from bottom to top - works great. But when we select .bottom appearance, library supposes that we hide using top-to-bottom swipe, and this causes whole app to collide. Can you add selection of swipe-to-remove direction? I think this will be the final feature that will make this library must have, when you need simple toast in any simple app.
Yes I am working on an implementation. See dev branch for details.
@lkuraer version 2.0 is released with a swipe direction option!
Great library. The problem is when enablePanToClose = true and direction = .bottom, when try to swipe from top to bottom - the whole app is trying to collapse (default for ios). Can you, please, add direction of swiping too?