Comments (14)
Hi @lkuraer,
thanks for reporting this. When I find some time I'll take a look at it.
PRs are always welcome 😄
from toast-swift.
Thank for your response , @Nikoloutsos , I beleive, you should try on real device. Actually there are two problems, please check attached screencast:
2023-01-27.12.52.48.mp4
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 #18
when try to pan to remove - library broke and toast can't be removed at all.
from toast-swift.
@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? 🤔
from toast-swift.
Yes I am working on an implementation. See dev branch for details.
from toast-swift.
@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()
}
}
}
CleanShot.2023-01-27.at.00.49.31.mp4
from toast-swift.
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 :).
from toast-swift.
@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?
from toast-swift.
I agree
from toast-swift.
Absolutely correct
from toast-swift.
@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.
from toast-swift.
@lkuraer
At this moment I don't have much free time to look into it.
from toast-swift.
@lkuraer the autohide + swipe bug should be resolved now.
from toast-swift.
@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.
from toast-swift.
@lkuraer version 2.0 is released with a swipe direction option!
from toast-swift.
Related Issues (20)
- How to show chain of Toasts HOT 1
- It seems memory leak caused by retain cycle HOT 1
- Tap to dismiss HOT 5
- Custom toast view HOT 1
- Dismiss callback HOT 2
- Timer invalidation breaking pan gesture HOT 5
- Custom styles HOT 1
- Running resolver because the following dependencies were added: 'toast-swift'
- Support animation type HOT 2
- Image doesn't show up
- Dark style HOT 3
- Add snapshot tests HOT 2
- Localization Support
- Binary operator '>' cannot be applied to operands of type 'CGFloat' and 'Double' HOT 2
- I have a problem. A really, really, big problem. HOT 7
- Number of lines option HOT 4
- Background colour customisation HOT 1
- Need toast message position ? HOT 2
- Custom font HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast-swift.