We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
謝謝你的分享
請問點選cell的問題 sample中的cellPressed在prepareForReuse中設定 viewModel?.cellPressed = nil, 滑動tableview時觸發 prepareForReuse後,點選cell就呼叫不到, viewModel?.cellPressed = nil 拿掉這行即正常。但是否會造成 retain cycle? 請問是什麼問題呢?謝謝
The text was updated successfully, but these errors were encountered:
viewModel?.cellPressed = nil 拿掉這行即正常。但是否會造成 retain cycle?
我也剛好遇到這個問題,後來的解法是將 viewModel.cellPressed = { ... } 移到 Cell 的 setup function,prepareForReuse保持viewModel?.cellPressed = nil
Sorry, something went wrong.
@rocooshiang 謝謝你的分享 移到cell裡的setup function後可以點選,但要如何傳給原先vc的vm做對應的處理呢? 範例中的 addBtnPressed 似乎也是同樣的情況
Hello 的確那個viewModel?.cellPressed = nil是需要拿掉的 抱歉這個應該是程式的bug 如果設定cell的view model時沒有參照到sel或者有記得用weak self,就不用擔心Retain cycle的問題囉
No branches or pull requests
謝謝你的分享
請問點選cell的問題
sample中的cellPressed在prepareForReuse中設定 viewModel?.cellPressed = nil,
滑動tableview時觸發 prepareForReuse後,點選cell就呼叫不到,
viewModel?.cellPressed = nil 拿掉這行即正常。但是否會造成 retain cycle?
請問是什麼問題呢?謝謝
The text was updated successfully, but these errors were encountered: