ComponentTableView is component-based , high UITableview controls reuse.
To make it easier UIViewController and decoupling Cell, we propose ComponentTableView. It assembles and business logic Cell entirely encapsulated in its own Component inside ( need to subclass the base class BaseAssemblyComponent), clean up UIViewController load is a completely middleware. Meanwhile Component API services and support internal hair page jump.
- Your ViewController inherit BaseAssemblyDispatcher class method to rewrite components ; for example :
- (NSArray *)components{
return [NSArray arrayWithObjects:
@[@"UIListTimeComponentKey", NSStringFromClass([UIListTimeComponent class])],
@[@"UITitleNumberComponentKey", NSStringFromClass([UITitleNumberComponent class])] ,nil];
}
-
Realize their middleware. First Inherited BaseAssemblyComponent, followed by initialization data source or accept the data that comes out in setupComponent source method , and then call the system draws TableviewCell approach. eg: UIListTimeComponent and UITitleNumberComponent
-
If you want to reuse someone else's middleware, only you need to modify the components method in UIViewController;
- From the first pod search ComponentTableView, if we continue to search for the second step . If you can not search , Run pod setup, clone copy locally. Then execute pod search ComponentTableView can see the various versions ;
- Add the pod "ComponentTableView" in Podfile in .
- Run pod install or pod update.
- Import the required header files . For example : #import "BaseAssemblyComponent.h"
- Download ComponentTableView folder all the contents .
- Add the source file ComponentTableView within ( drag and drop ) to your project .
- Import the required header files . For example : #import "BaseAssemblyComponent.h"
You can view the online API documentation CocoaDocs, you can also generate documents in appledoc locally.
ComponentTableView use MIT license , as detailed LICENSE file .