gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

耦合性如何处理? #268

Open xuguoyongmac opened 6 years ago

xuguoyongmac commented 6 years ago

Cell的高度自适应的时候, 需要给cell一个成员属性model这样的一个key, 换句话说 ,也就是需要在cell里面直接使用到model ,这样 cell和model直接就产生了耦合,如果其他界面需要这样cell的时候 ,就需要一个相同的model或者是一个otherModel这样的属性,然后再重新布局,这样无论是从MVC的角度 或者是MVVM的角度来说 ,都已经是违背本身的原理的 ,而且这样的Cell复用程度并不高,有没有什么方法来处理这样的问题?