I have the bellow callback in a class:
class something: NSObject {
//some other code but NO Init()
var done:((Bool)->())?
}
I try using it as seen bellow (called on didSet
of another var):
done!(true)//error
This however leads to the app crashing at this spot.
What am I doing wrong and how can I fix it? I believe that the issue may be related to not having initializers??
I should add that I use it like this in another class:
currentPost.done = { [weak self] (done) in
if done {
self.update(line: currentPost.line!)
}
}