Git Product home page Git Product logo

Comments (14)

Nikoloutsos avatar Nikoloutsos commented on June 7, 2024 1

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.

lkuraer avatar lkuraer commented on June 7, 2024 1

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:
Screenshot 2023-01-27 at 12 53 29

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.

Nikoloutsos avatar Nikoloutsos commented on June 7, 2024 1

@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.

BastiaanJansen avatar BastiaanJansen commented on June 7, 2024 1

Yes I am working on an implementation. See dev branch for details.

from toast-swift.

Nikoloutsos avatar Nikoloutsos commented on June 7, 2024

@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.

BastiaanJansen avatar BastiaanJansen commented on June 7, 2024

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.

lkuraer avatar lkuraer commented on June 7, 2024

@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.

BastiaanJansen avatar BastiaanJansen commented on June 7, 2024

I agree

from toast-swift.

lkuraer avatar lkuraer commented on June 7, 2024

Absolutely correct

from toast-swift.

lkuraer avatar lkuraer commented on June 7, 2024

@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.

Nikoloutsos avatar Nikoloutsos commented on June 7, 2024

@lkuraer
At this moment I don't have much free time to look into it.

from toast-swift.

BastiaanJansen avatar BastiaanJansen commented on June 7, 2024

@lkuraer the autohide + swipe bug should be resolved now.

from toast-swift.

lkuraer avatar lkuraer commented on June 7, 2024

@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.

BastiaanJansen avatar BastiaanJansen commented on June 7, 2024

@lkuraer version 2.0 is released with a swipe direction option!

from toast-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.