039.category 对类进行模块化设计

来源:互联网 发布:官路淘宝全文免费阅读 编辑:程序博客网 时间:2024/06/05 10:06
@interface UIView : UIResponder <NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem,UITraitEnvironment, UICoordinateSpace>

@interface UIView(UIViewGeometry)

@interface UIView(UIViewHierarchy)

@interface UIView(UIViewRendering)

@interface UIView(UIViewAnimation)



一、编写本节代码的具体步骤:
1.本节代码通过查阅Xcode自带文件 UIView.h 可得。

二、本节代码涉及到的知识点:
1.假如一个类非常庞大,那么把该类所有的实现文件放在一个源文件中,显然不太实际。
2.例如UIView,系统就利用了category对其进行了模块化设计。
3.UIView通过category分类的方式,将类的实现文件分布到不同的.m文件中。
0 0