Giter Club home page Giter Club logo

Comments (6)

ibireme avatar ibireme commented on July 20, 2024

没什么优势。。功能也不会有什么差异。
这块儿直接从 UIControl+YYAdd 里拷过来的代码,所以相关逻辑也带过来了。

from yycategories.

yeziahehe avatar yeziahehe commented on July 20, 2024

@ibireme 我想了很久,一直徘徊这里,其实只是两种实现方式。因为Associated Objects优势体现在要自定义属性的时候。
我的另外一个问题,再有自定义属性的时候,什么情况下选用继承,什么情况下选用Associated Objects去做Category呢?

from yycategories.

ibireme avatar ibireme commented on July 20, 2024

没必要的话就不要用 Associated Objects,写起来麻烦,性能又不高。

from yycategories.

yeziahehe avatar yeziahehe commented on July 20, 2024

性能不高指的是?是否有文档解释这个性能?

from yycategories.

ibireme avatar ibireme commented on July 20, 2024

没文档,但可以自己测一下。

from yycategories.

yeziahehe avatar yeziahehe commented on July 20, 2024

好的,感谢!

from yycategories.

Related Issues (20)

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.