Im trying to queue up multiple messages, but I can only ever get SwiftMessages to show the first message in the loop. Is there a trick to using the built-in queue? Im calling the following code when an URLSession completes:
DispatchQueue.main.async {
for message in messages {
if let view: MyMessageView = try? SwiftMessages.viewFromNib() {
view.message = message
SwiftMessages.show(view: view)
}
}
}
Using the debugger i can confirm that SwiftMessages.show() is indeed called multiple times, even though only 1 message is shown
MyMessageView doesnt really contain any logic, all it does is set some colors
I have tried not using DispatchQueue.main.async but it doesnt seem to make a difference
Ok, so the view ID is generated by its title+message so if these are not set, and you dont manually set the ID, the queue will not work. Would be nice if that could be made more clear in the docs :)
Most helpful comment
Ok, so the view ID is generated by its title+message so if these are not set, and you dont manually set the ID, the queue will not work. Would be nice if that could be made more clear in the docs :)