Toast-Swift
Toast-Swift copied to clipboard
Problem when try show concatenate toast activity
Hi, I want to concatenate two messages as toast activity, but it doesn't work. Here is mi code:
func testToast(){
self.view.makeToastActivity(message: "1")
DispatchQueue.global().async {
sleep(1)
DispatchQueue.main.async {
self.view.hideToastActivity()
self.view.setNeedsLayout()
self.view.makeToastActivity(message: "2")
}
sleep(1)
DispatchQueue.main.async {
self.view.hideToastActivity()
}
}
}
Only the first toast activity is showed and (after 1 second) it is hidden, but the second toast activity never show. Why?, Someone can help me to do what I want????
Thanks in advance!