You can use "typealias" instead of "ToastCompletionWrapper"
Closed this issue · 1 comments
FunnyerFeng commented
You can use:
typealias completion = ((Bool) -> Void)?
instead of:
private class ToastCompletionWrapper {
let completion: ((Bool) -> Void)?
init(_ completion: ((Bool) -> Void)?) {
self.completion = completion
}
}
scalessec commented
The objc_setAssociatedObject
API requires the associated object to be a class, so unfortunately simply using a typealias for the completion closure does not work.