You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assigning an ImageViewModel to a UIImageView does not cancel the subscription to the viewModel's imageFlow when the UIView is deallocated.
classMyView:UIView{privateletmyImageView=UIImageView()varmyViewModel:MyViewModel{
didSet {
myImageView.imageViewModel = myViewModel.imageViewModel
}}overrideinit(frame:CGRect){
super.init(frame: frame)addSubview(myImageView)}deinit{
// We need to manually set the image's viewModel to nil, otherwise the subscription to the imageFlow is never cancelled
myViewModel.imageViewModel =nil}}
The text was updated successfully, but these errors were encountered:
Assigning an
ImageViewModel
to aUIImageView
does not cancel the subscription to the viewModel'simageFlow
when the UIView is deallocated.The text was updated successfully, but these errors were encountered: