Pre loader

Using Annotation Selection Changed Listener with Swift

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
0
0

Hi,

How can i listen annotation selection changes? I try this code but i’m getting error “Cannot assign to property: ‘lineAnnotation’ is immutable”

var lineAnnotation = SCILineAnnotation()
lineAnnotation.annotationSelectionChangedListener = { (annotation, isSelected) in
//
}

Tnx.

Version
3.1.0.5175
  • You must to post comments
Best Answer
2
0

Hi there,

You missed return type in your closure, please see the API docs
Thats actually a mistake in API and that will be fixed in one of the next nightly builds

For now, please use the code like below:

lineAnnotation.annotationSelectionChangedListener = { (annotation, isSelected) -> Bool in
    print("isSelected: \(isSelected)")
    return true
}

Hope that helps.

Best Regards,
Nazar R.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies