Code Monkey home page Code Monkey logo

Comments (6)

huangboju avatar huangboju commented on August 21, 2024

你的意思是同一个cell的数据,需要多个model组合起来吗

from formview.

focus-ming avatar focus-ming commented on August 21, 2024

你的意思是同一个cell的数据,需要多个model组合起来吗

不不 比如有个ButtonCell 在A页面 有个A类型的model ButtonCell 需要通过A model 来设置UI
在B页面也用到了ButtonCell 但是此时Model为B 此时需要通过B model来设置UI 这样的Case怎么处理

from formview.

huangboju avatar huangboju commented on August 21, 2024

哦哦,懂你的意思你,想想为什么我在cell与model之间抽象了一层cellModel,其实你是不是可以抽象一个协议,buttonCell依赖你的协议,然后cellModel去遵循抽象的协议,这样应该就可以解决了吧

from formview.

focus-ming avatar focus-ming commented on August 21, 2024

哦哦,懂你的意思你,想想为什么我在cell与model之间抽象了一层cellModel,其实你是不是可以抽象一个协议,buttonCell依赖你的协议,然后cellModel去遵循抽象的协议,这样应该就可以解决了吧

明白 我尝试一下 谢谢大佬

from formview.

huangboju avatar huangboju commented on August 21, 2024

哦哦,懂你的意思你,想想为什么我在cell与model之间抽象了一层cellModel,其实你是不是可以抽象一个协议,buttonCell依赖你的协议,然后cellModel去遵循抽象的协议,这样应该就可以解决了吧

明白 我尝试一下 谢谢大佬

不客气,其实你再抽象个协议,你的didselect处理,也能放到cellmodel了,这样就形成了一条链路,UI的数据,事件处理,都再cellModel里面了,VC就起到一个协调作用,VC的代码就会非常干净,整个架构扩展性也会很强

from formview.

ios582754 avatar ios582754 commented on August 21, 2024

哦哦,懂你的意思你,想想为什么我在cell与model之间抽象了一层cellModel,其实你是不是可以抽象一个协议,buttonCell依赖你的协议,然后cellModel去遵循抽象的协议,这样应该就可以解决了吧

明白 我尝试一下 谢谢大佬

你是实现了吗,老哥,能借鉴下吗,

from formview.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.