Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Introduce color types #34

Closed
artworkad opened this issue Aug 3, 2015 · 2 comments
Closed

Feature Request: Introduce color types #34

artworkad opened this issue Aug 3, 2015 · 2 comments

Comments

@artworkad
Copy link

Would like to do:

JLToast.makeText("FooBar", type: JLToastType.Green).show()

with types:

JLToastType.Green
JLToastType.Red
JLToastType.Black (default)

or other example:

JLToast.makeText("FooBar").show(JLToastType.Green)

or

JLToast.makeText("FooBar").showSuccess()

Use-case: I want to make toasts more meaningful like "this is an error" or "entry created successfully". I know there is a way to customize the background but my suggestion would make it easier.

We should be able to customize those types.

@devxoul
Copy link
Owner

devxoul commented Aug 3, 2015

As we did in #31, you can set background color of JLToastView. For reusable purpose, you can make a wrapper class for it.

public class MyToast {

    public class func showSuccess(text: String) {
        let toast = JLToast.makeText(text)
        toast.view.backgroundColor = UIColor.greenColor()
        toast.show()
    }

}

MyToast.showSuccess("FooBar")

@artworkad
Copy link
Author

lel 😄 thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants