Coder Social home page Coder Social logo

Comments (8)

devxoul avatar devxoul commented on July 19, 2024

@hengchengfei,
Could you please explain more detail to me?
Thanks.

from toaster.

hengchengfei avatar hengchengfei commented on July 19, 2024

我的意思是,

连续点击弹出按钮,也就是连续调用JLToast.makeText()。

比如非常快的点击10次,会连续出来10个信息窗口。

而我希望在前一个弹出窗口还没消失的时候,不能再弹出窗口了。

但是我没发判断前一个窗口有没消失。

from toaster.

hengchengfei avatar hengchengfei commented on July 19, 2024

repeat click the button,for example 10 times,then Toast view 10 times。

i want to show the next toast after the previous toast hide。

from toaster.

devxoul avatar devxoul commented on July 19, 2024

Do you want 'hide previous toast and show new toast'?

from toaster.

hengchengfei avatar hengchengfei commented on July 19, 2024

Yes

from toaster.

devxoul avatar devxoul commented on July 19, 2024

That's not officially supported right now. (I'll make it as soon as possible)

However you can do with this:

previousToast.finish()
previousToast.view.removeFromSuperview()
// then show new toast

from toaster.

uknowmeright avatar uknowmeright commented on July 19, 2024

here is some code that might help. It doesn't work in every situation but it might help you develop something fully functional:

`
var toasts = JLToast

func removeTheToast(toast: JLToast){
    for theToast in self.toasts{
        if theToast != toast {
            theToast.finish()
            theToast.view.removeFromSuperview()
        }
    }
}`


func showToast(string: String){
    let toast = JLToast.makeText(string.localized, duration: JLToastDelay.ShortDelay)
    toast.show()
    toasts.append(toast)
    removeTheToast(toast)
}

from toaster.

devxoul avatar devxoul commented on July 19, 2024

Hey guys, thanks for waiting. #74 might help.

from toaster.

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.