Hello I have following requirement.
I want to call completion block after the delegate method triggered.
Please find bellow sample snippet as example.
typealias CompletionBlock = (_ result: NSData?, _ error: NSError?) -> Void
func Method1(block:CompletionBlock)
{
//SOME CODE
}
func Method2
{
Completion(data,error)
}
Method2
is my delegate method.
So when I call Method1
from some other class it will enter into block once pointer is on Method2