Open Sajjon opened 6 years ago
I saw that you actually use capture list in CreatePostViewModel
:
.flatMapLatest { [unowned self] in
return self.createPostUseCase.save(post: $0)
.trackActivity(activityIndicator)
.asDriverOnErrorJustComplete()
}
But you use unowned self
which would result in a crash if it were to be deallocated right?
Hi, @Sajjon
Regarding:
I just have one short question, in your ViewModels transform:input method you do use capture list to weakify self, e.g. in EditPostViewModel
I do not think it's a retain cycle as we do not keep reference to the savePost
observable. It's retained by the disposeBag
in the ViewController
which will release everything on deinit
.
So there is no need even for unowned
in the CreatePostViewModel
Hey! Awesome project! Your code is so inspiring!
I just have one short question, in your ViewModels
transform:input
method you do use capture list to weakify self, e.g. inEditPostViewModel
You use
self.useCase.save
, isn't this a retain cycle? Dont we have to use:Thanks!