CWKViewDataSource Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | CWKView.h |
Overview
This protocol is used to route network traffic through the host app instead of using the built in networking (optional)
Network Traffic Re-Routing
– chartView:performNetworkOperationForURL:onCompletion:
required method
CWKViewDataSource protocol is designed to allow the hosting application to log transactions to/from the ChartworksKit SDK. This method on the CWKView’s dataSource called when it needs data to populate the chart, or request symbol information. The dataSource object is expected to perform the required network request, and call the completion block with the data from the request or an error object if the request did not succeed.
- (void)chartView:(CWKView *)chartView performNetworkOperationForURL:(NSURLRequest *)request onCompletion:(CWKNetworkCompletion)onCompletion
Parameters
chartView |
The chart view in use |
---|---|
request |
The NSURL request |
onCompletion |
This is the block object to be called when the request has been completed. |
Discussion
Warning: CWKView’s delegate will still receive: chartView:willPerformNetworkRequest: and chartView:finishedNetworkRequest:error: since these methods are for notification on pending and completed events. In the future this may be configurable behavior.
Declared In
CWKView.h