I have a simple class where I declare a block as a variable:
class MyObject : NSObject { var progressBlock:(progress:Double) -> ()? init() { } }
As far as I understand, if it is defined in this way, progressBlock does not need to be initialized in the initializer init()
However, when I try to compile, I get its error:
Property 'self.progressBlock' not initialized at super.init
So the question is, how do I create an optional progressBlock , so I am not getting this error?
ios swift objective-c-blocks optional
zumzum
source share