I rarely see people using [weak self]
in didSet
. Is there a reason for this?
I tried to use [weak self]
in my didSet
of a variable:
var data: Dictionary<String, Any>! { // [1]
didSet { [2]
self?.layoutSubviews()
}
}
Either I put [weak self] in
at [1] or [2], I still get the error: Use of unresolved identifier weak
Why is that? Is it illegal to use [weak self]
for a didSet
?
Regards,