To explain this in detail, start with your code snippet.
Target C typedef void(^TyphoonDefinitionBlock)(TyphoonDefinition *definition);
In Swift, you do it like this typealias TyphoonDefinitionBlock = (definition:TyphoonDefinition?)->Void
If you want to communicate intimately with the caller after a certain point, you need to make a property. var typhoonDefinitionCompletion:BlockTyphoonDefinitionBlock?
you can use typhoonDefinitionCompletion and you can raise a callback message like this. self.typhoonDefinitionCompletion!(definition:passyourtyphoneDefinition)
Kamarshad
source share