Skip to content
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

请教一个问题关于数据持有 #11

Open
fndppx opened this issue Mar 22, 2018 · 3 comments
Open

请教一个问题关于数据持有 #11

fndppx opened this issue Mar 22, 2018 · 3 comments

Comments

@fndppx
Copy link

fndppx commented Mar 22, 2018

如果传递给DataSource里边的array在外部需要动态改变呢,这个时候怎么再次传递给tablview呢

@SunnnLucky
Copy link

可以吧DataSource里的items也就是模型数组暴露出来,控制器改变的时候重新赋值items

@alexwong0818
Copy link

感觉暴露出来不太好,可以借鉴mvvm的方式监听VM数据源,当数据源变动时通知相应的刷新方法

@SunnnLucky
Copy link

你说的有道理,不过我对MTVM的理解不是很透彻,或者也可以写个传数组的方法在数据源里,只要relodData前把数据源里的数组改变了就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants