-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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重用的问题 #2
Comments
你的意思是同一个cell的数据,需要多个model组合起来吗 |
不不 比如有个ButtonCell 在A页面 有个A类型的model ButtonCell 需要通过A model 来设置UI |
哦哦,懂你的意思你,想想为什么我在cell与model之间抽象了一层cellModel,其实你是不是可以抽象一个协议,buttonCell依赖你的协议,然后cellModel去遵循抽象的协议,这样应该就可以解决了吧 |
明白 我尝试一下 谢谢大佬 |
不客气,其实你再抽象个协议,你的didselect处理,也能放到cellmodel了,这样就形成了一条链路,UI的数据,事件处理,都再cellModel里面了,VC就起到一个协调作用,VC的代码就会非常干净,整个架构扩展性也会很强 |
你是实现了吗,老哥,能借鉴下吗, |
想问一下大佬 APP中有些使用场景是同一个cell可能会对应不同的model
但是目前这套模式 cell的viewdata直接定死了cell惟一对应的model类型。导致同样的Cell无法绑定其它类型的model。 不知道大佬有解决方案吗?
The text was updated successfully, but these errors were encountered: