CWKViewDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | CWKView.h |
Overview
The delegate of an CWKView object must implement the CWKViewDelegate protocol. Currently, all methods are optional and provide information about the state of the CWKView or hooks for certain actions within the CWKView.
User Experience Notification Delegates
– chartView:symbol:informationDictionary:error:
This method returns a dictionary and is the callback for getInformationForSymbol
- (void)chartView:(CWKView *)chartView symbol:(NSString *)symbol informationDictionary:(nullable NSDictionary<NSString*,id> *)dictionary error:(nullable NSError *)error
Parameters
chartView |
The chart view in use |
---|---|
symbol |
The symbol to look up |
dictionary |
The dictionary containing all of the data returned |
error |
The error object is non nil if there was an error requesting the symbol. |
Declared In
CWKView.h
– chartView:symbolSummaryDictionary:error:
This method returns a dictionary for a requested symbol or an error if the network call was not successful.
- (void)chartView:(CWKView *)chartView symbolSummaryDictionary:(nullable NSDictionary<NSString*,id> *)dictionary error:(nullable NSError *)error
Parameters
chartView |
The chart view in use |
---|---|
dictionary |
The dictionary containing all of the data returned |
error |
The error object is non nil if there was an error requesting the symbol. |
Declared In
CWKView.h
– chartView:addIndicatorUpperButtonTapped:
This method is called when the upper chart “+ Indicators” button is tapped.
- (void)chartView:(CWKView *)chartView addIndicatorUpperButtonTapped:(UIButton *)button
Parameters
chartView |
The CWKView |
---|---|
button |
The “+ Indicator” button |
Declared In
CWKView.h
– chartView:addIndicatorLowerButtonTapped:
This method is called when the lower chart “+ Indicators” button is tapped.
- (void)chartView:(CWKView *)chartView addIndicatorLowerButtonTapped:(UIButton *)button
Parameters
chartView |
The CWKView |
---|---|
button |
The “+ Indicator” button |
Declared In
CWKView.h
– chartView:willPerformNetworkRequest:
Notify the delegate that a network activity is about to begin
- (void)chartView:(CWKView *)chartView willPerformNetworkRequest:(CWKArea)chartArea
Parameters
chartView |
The CWKView that is starting the network request |
---|---|
chartArea |
Identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
Discussion
This optional delegate method will notify the client when network activity begins. This could be used to allow the client to put up a UIActivityIndicator or some other UI element to alert the user of a network request.
Declared In
CWKView.h
– chartView:finishedNetworkRequest:error:
Notify the delegate that a network activity has just finished.
- (void)chartView:(CWKView *)chartView finishedNetworkRequest:(CWKArea)chartArea error:(nullable NSError *)error
Parameters
chartView |
The CWKView |
---|---|
chartArea |
identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
error |
This will be non-nil if an error occurred. |
Discussion
This optional delegate method will notify the client when the network activity ends.
Declared In
CWKView.h
– chartViewNoDataToShowForUpperChartArea:
Notify the delegate that a the chart doesn’t have data to show
- (void)chartViewNoDataToShowForUpperChartArea:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartViewWillChangeVisibilityOfLowerChart:lowerChartHidden:
Notify the delegate that the lower chart is being hidden or show based on having active lower indicators.
- (void)chartViewWillChangeVisibilityOfLowerChart:(CWKView *)chartView lowerChartHidden:(BOOL)lowerChartHidden
Parameters
chartView |
The CWKView |
---|---|
lowerChartHidden |
whether the lower chart has been hidden. |
Declared In
CWKView.h
– chartView:willStartPanLoadAfterDelay:
Notify the delegate that a countdown to start pan load has begun
- (void)chartView:(CWKView *)chartView willStartPanLoadAfterDelay:(NSTimeInterval)delay
Parameters
chartView |
The CWKView |
---|---|
delay |
the countdown duration |
Declared In
CWKView.h
– chartViewPanLoadWasCancelled:
Notify the delegate that the pan load countdown was cancelled
- (void)chartViewPanLoadWasCancelled:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartViewPanLoadHasBegun:
Notify the delegate that a pan load has just begun
- (void)chartViewPanLoadHasBegun:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartView:finishedPanLoad:error:
Notify the delegate that a pan load has just finished.
- (void)chartView:(CWKView *)chartView finishedPanLoad:(CWKArea)chartArea error:(nullable NSError *)error
Parameters
chartView |
The CWKView |
---|---|
chartArea |
identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
error |
This will be non-nil if an error occurred. |
Discussion
This optional delegate method will notify the client when a pan load has ended.
Declared In
CWKView.h
– chartView:willStartZoomOutLoadAfterDelay:
Notify the delegate that a countdown to start zoom load has begun
- (void)chartView:(CWKView *)chartView willStartZoomOutLoadAfterDelay:(NSTimeInterval)delay
Parameters
chartView |
The CWKView |
---|---|
delay |
the countdown duration |
Declared In
CWKView.h
– chartViewZoomOutLoadWasCancelled:
Notify the delegate that the zoom load countdown was cancelled
- (void)chartViewZoomOutLoadWasCancelled:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartViewZoomOutLoadHasBegun:
Notify the delegate that a zoom load has just begun
- (void)chartViewZoomOutLoadHasBegun:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartView:finishedZoomOutLoad:error:
Notify the delegate that a zoom load has just finished.
- (void)chartView:(CWKView *)chartView finishedZoomOutLoad:(CWKArea)chartArea error:(nullable NSError *)error
Parameters
chartView |
The CWKView |
---|---|
chartArea |
identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
error |
This will be non-nil if an error occurred. |
Discussion
This optional delegate method will notify the client when a zoom load has ended.
Declared In
CWKView.h
– chartView:willStartZoomInLoadAfterDelay:
Notify the delegate that a countdown to start zoom load has begun
- (void)chartView:(CWKView *)chartView willStartZoomInLoadAfterDelay:(NSTimeInterval)delay
Parameters
chartView |
The CWKView |
---|---|
delay |
the countdown duration |
Declared In
CWKView.h
– chartViewZoomInLoadWasCancelled:
Notify the delegate that the zoom load countdown was cancelled
- (void)chartViewZoomInLoadWasCancelled:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartViewZoomInLoadHasBegun:
Notify the delegate that a zoom load has just begun
- (void)chartViewZoomInLoadHasBegun:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartView:finishedZoomInLoad:error:
Notify the delegate that a zoom load has just finished.
- (void)chartView:(CWKView *)chartView finishedZoomInLoad:(CWKArea)chartArea error:(nullable NSError *)error
Parameters
chartView |
The CWKView |
---|---|
chartArea |
identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
error |
This will be non-nil if an error occurred. |
Discussion
This optional delegate method will notify the client when a zoom load has ended.
Declared In
CWKView.h
– chartView:willStartReduceDetailLoadAfterDelay:
Notify the delegate that a countdown to reduce detail load has begun
- (void)chartView:(CWKView *)chartView willStartReduceDetailLoadAfterDelay:(NSTimeInterval)delay
Parameters
chartView |
The CWKView |
---|---|
delay |
the countdown duration |
Declared In
CWKView.h
– chartViewReduceDetailLoadWasCancelled:
Notify the delegate that the reduce detail countdown was cancelled
- (void)chartViewReduceDetailLoadWasCancelled:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartViewReduceDetailLoadHasBegun:
Notify the delegate that a reduce detail load has just begun
- (void)chartViewReduceDetailLoadHasBegun:(CWKView *)chartView
Parameters
chartView |
The CWKView |
---|
Declared In
CWKView.h
– chartView:finishedReduceDetailLoad:error:
Notify the delegate that a reduce detail load has just finished.
- (void)chartView:(CWKView *)chartView finishedReduceDetailLoad:(CWKArea)chartArea error:(NSError *)error
Parameters
chartView |
The CWKView |
---|---|
chartArea |
identifies the area of the chart in which there was network activity. Please look at the CWKArea enum |
error |
This will be non-nil if an error occurred. |
Discussion
This optional delegate method will notify the client when a reduce detail has ended.
Declared In
CWKView.h
– chartView:removedComparison:currentComparisonList:
Notify the delegate that the comparison list has changed
- (void)chartView:(CWKView *)chartView removedComparison:(NSString *)symbol currentComparisonList:(NSArray<CWKSecuritySymbol*> *)comparisonList
Parameters
chartView |
The CWKView |
---|---|
symbol |
This is the name of the symbol that was removed. |
comparisonList |
An NSArray that has the current list of symbols. |
Discussion
This method is called when the indicatorUpperLegendButtonShown is enabled and the user has decided to remove a submitted symbol from the comparison list. It is expected that the client will always maintain a list of symbols that has been submitted to the chart view for comparison and thus will need to be told when the user has made a change by removing an item within the Charting UI.
Declared In
CWKView.h
– chartView:removedUpperIndicator:currentUpperIndicatorList:
Notify the delegate that the upper indicator list has changed due to user tapping the remove button This method is called when the remove button in the indicator popover is tapped and the user has decided to remove a upper indicator from the chart.
- (void)chartView:(CWKView *)chartView removedUpperIndicator:(CWKUpperIndicator)indicator currentUpperIndicatorList:(NSArray *)upperIndicatorList
Parameters
chartView |
The CWKView |
---|---|
indicator |
This is the CWKUpperIndicator that was removed. |
upperIndicatorList |
An NSArray that has the current list of upper indicators. |
Declared In
CWKView.h
– chartView:removedLowerIndicator:currentLowerIndicatorList:
Notify the delegate that the lower indicator list has changed due to user tapping the remove button This method is called when the remove button in the indicator popover is tapped and the user has decided to remove a lower indicator from the chart.
- (void)chartView:(CWKView *)chartView removedLowerIndicator:(CWKLowerIndicator)indicator currentLowerIndicatorList:(NSArray *)lowerIndicatorList
Parameters
chartView |
The CWKView |
---|---|
indicator |
This is the CWKLowerIndicator that was removed. |
lowerIndicatorList |
An NSArray that has the current list of lower indicators. |
Declared In
CWKView.h
– chartView:announcementTapped:
Notify the delegate that an announcement was tapped
- (void)chartView:(CWKView *)chartView announcementTapped:(id)announcementID
Parameters
chartView |
The CWKView |
---|---|
announcementID |
the announcement that was tapped |
Discussion
This method is called when an announcement on the upper chart is tapped;
Declared In
CWKView.h
– chartView:announcementRemoved:
This method is called when the upper chart removes a custom announcement.
- (void)chartView:(CWKView *)chartView announcementRemoved:(NSString *)announcementID
Parameters
chartView |
The CWKView |
---|---|
announcementID |
a string with the ID of the announcement that was removed |
Declared In
CWKView.h
– chartView:startRenderChart:fullRedraw:
A notification that the chart object has started rendering. This is called before the chart starts rendering its data. At this point, the chart axes will be up to date with your data, so a common use case of this method would be to update the chart axes before they are rendered, for example to modify the axis title or range.
- (void)chartView:(CWKView *)chartView startRenderChart:(CWKArea)chartArea fullRedraw:(BOOL)fullRedraw
Parameters
chartView |
The chart view which has started rendering. |
---|---|
chartArea |
Indicating if upper or lower chart. |
fullRedraw |
If the chart is carrying out a full redraw, this argument is set to |
Declared In
CWKView.h
– chartView:finishedRenderChart:
A notification that the chart object has finished rendering. This is called once the chart has finished rendering its data. A common use case for this method would be to display the crosshair on the chart after it has rendered, or to add annotations onto the chart. You could also update other UI elements in your application so that they reflect the new state of the chart. You shouldn’t modify the chart plot area or its axes here, as any changes won’t be visualized until the next time that the chart is rendered.
- (void)chartView:(CWKView *)chartView finishedRenderChart:(CWKArea)chartArea
Parameters
chartView |
The chart view which has finished rendering. |
---|---|
chartArea |
Indicating if upper or lower chart. |
Declared In
CWKView.h
– chartView:didFinishLoading:
A notification that the chart object has finished loading data. This is called once the chart has finished loading its data, and before it starts rendering its plot area and axes. A common use of this method would be to close the activity indicator if you popped one up during loading. At this point, the chart axes will have been refreshed from the new data, so you could update the chart axes here before they are rendered. It is important to note that this method is only called when we load data, rather than each time the chart is rendered.
- (void)chartView:(CWKView *)chartView didFinishLoading:(CWKArea)chartArea
Parameters
chartView |
The chart view which has finished loading the data. |
---|---|
chartArea |
Indicating if upper or lower chart. |
Declared In
CWKView.h
– chartView:annotation:didFinishDrawingAtPoint:endPoint:uniqueID:
A notification that the user has finished drawing a custom annotation. This can be used to end a drawing mode and let the user know the draw mode has ended.
- (void)chartView:(CWKView *)chartView annotation:(CWKAnnotationType)annotationType didFinishDrawingAtPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint uniqueID:(NSString *)uniqueID
Parameters
chartView |
The chart view which has finished loading the data. |
---|---|
startPoint |
The point at which the annotation starts. |
endPoint |
The point at which the annotation ends. |
uniqueID |
The unique ID of the new annotation annotation. |
Declared In
CWKView.h
– chartView:textAnnotationCreatedAtPoint:
A notification that the end user has tapped a point where they would like a text annotation to be created. The app should show a dialog prompting the user for the text to use, then call drawTextAnnotationWithText:
- (void)chartView:(CWKView *)chartView textAnnotationCreatedAtPoint:(CGPoint)point
Parameters
chartView |
The chart view which has finished loading the data. |
---|---|
point |
The point at which the annotation will be created. |
Declared In
CWKView.h
– chartView:textAnnotationBeganEditingWithText:uniqueID:
A notification that the end user has begun text editing on a text annotation. The app should show a dialog prompting the user for the text to use, then call updateTextAnnotationWithUniqueID:withText:
- (void)chartView:(CWKView *)chartView textAnnotationBeganEditingWithText:(NSString *)text uniqueID:(NSString *)uniqueID
Parameters
chartView |
The chart view which has finished loading the data. |
---|---|
text |
The original text from the annotation. |
uniqueID |
The unique ID of the new annotation annotation. |
Declared In
CWKView.h
– chartView:crosshairUpdatedWithData:
When using a custom crosshair, a notification that the crosshair changed position, and to update the tooltip accordingly.
- (void)chartView:(CWKView *)chartView crosshairUpdatedWithData:(CWKCrosshairData *)data
Parameters
chartView |
The chart view which has finished loading the data. |
---|---|
data |
A CWKCrosshairData object containing all the data pertaining to the crosshair. |
Declared In
CWKView.h
– chartView:crosshairDidHide:
When using a custom crosshair, a notification that the crosshair was hidden.
- (void)chartView:(CWKView *)chartView crosshairDidHide:(BOOL)hidden
Parameters
chartView |
The chart view containing the crosshair which was hidden or shown |
---|---|
hidden |
YES = the crosshair was hidden, NO = the crosshair was shown |
Declared In
CWKView.h