In this code:
@objc func postToken(completion: (()-> Void)? = nil) {
someBlock {
completion?()
}
}
when added as a call using a selector, like so:
let tokenIndicatorGesture = UITapGestureRecognizer(target: self, action: #selector(postToken))
the closure is not nil and thus crashes at the completion?() line.
the value looks like:
completion (())? 0x00000001049476f8 MyApp`partial apply forwarder for reabstraction thunk helper from @escaping @callee_unowned @convention(block) () -> () to @escaping @callee_guaranteed () -> () at <compiler-generated>
Searching for the error didn't return much so I am looking for some help figuring this out.