BastiaanJansen / toast-swift

Customizable Swift Toast view built with UIKit. 🍞
MIT License
478 stars 77 forks source link

Dark style #3

Closed Dave181295 closed 2 years ago

Dave181295 commented 2 years ago

I don't see where I can apply the dark style toast, there is no parameters ?

BastiaanJansen commented 2 years ago

Right now, the system theme will be applied to the built-in toast views.

BastiaanJansen commented 2 years ago

If you really want to change the theme programmatically, you could create your own view. For more information about using custom views: https://github.com/BastiaanJansen/Toast-Swift#custom-toast-view

(I think you could even extend the AppleToastView class and change the background color, so you don't have to create the layout from scratch.)

Zandor300 commented 2 years ago

@Dave181295

let toast = Toast(view: AppleToastView(
    child: IconAppleToastView(image: image, imageTint: imageTint, title: title, subtitle: subtitle),
    darkBackgroundColor: UIColor.black,
    lightBackgroundColor: UIColor.black
), config: ToastConfiguration())
toast.show()