I defined the property in Swift as:
var foo : String {
didSet {
doSomething()
}
}
Therefore, every time I set foohow foo = "bar", mine didSetwill be executed.
However, I cannot find where the thread is running didSet .
For example, what happens in this case:
dispatch_async(some_queue, { () -> Void in
self.foo = "bar"
})
This will lead to code execution didSet. Will it run didSeton some_queueor always on main_queue?
source
share