This topic describes the methods of the core classes of the Ant Cube Card engine.
createCard
/**
Create a single card
@ param config Card configuration parameters
@ param callback The callback for creating a card.
*/
- (void)createCard:(CubeCardConfig *)config callback:(id<CCardCallback>)callback;createCards
/**
Create a batch of cards. Each card result is called back once.
@ param configs Configure parameters for cards in batches.
@ param callback The callback for creating a card.
*/
- (void)createCards:(NSArray<CubeCardConfig *> *)configs callback:(id<CCardCallback>)callback;createView
/**
Create a rendering view
@return CubeView
*/
- (CubeView *)createView;setCustomUnit
/**
Set custom units
@ param unitName The name of the company, such as sip
@ param unitRadio Unit ratio, for example, 1.5
*/
- (void)setCustomUnit:(NSString *)unitName unitRadio:(float)unitRadio;registerModules
/**
Set up a custom extension module
@ param modules Dictionary, key is the module name, such as animation, and value is the class name, such as CKAnitmationModule
*/
- (void)registerModules:(NSDictionary<NSString *, NSString *> *)modules;registerWidgets
/**
Register a component
@ param widgets The configuration of the widget.
*/
- (void)registerWidgets:(NSArray<CubeWidgetInfo *> *)widgets;sendEvent
/**
Native sends custom event channels to the JS side
@ param widgetData The component data, which is the input parameter data when the component is created by onCreateView in CCardWidget. You can pass it through here.
@ param eventName The name of the custom event.
@ param eventParams Custom event parameters
*/
- (void)sendEvent:(NSDictionary *)widgetData eventName:(NSString *)eventName eventParams:(NSDictionary*)eventParams;