Error when assigning to a swift property


#1

I am developing a plugin for iOS, I am trying to assign the data parameter, however I get the error:

 JS ERROR TypeError: Attempted to assign to readonly property.

The line I am trying to assign is defined here: https://github.com/danielgindi/Charts/blob/0d33db4da87a549abb8d517d71ac2c36ecd731a5/Source/Charts/Charts/ChartViewBase.swift#L191

The code being used is here:

The demo defined by the chart library is here:

I hope this is enough information.

Many Thanks,

Jack


#2

LineChartView is basically inherited from UIView not NSObject. You would initialise UIView in different way, usually by alloc method with a frame.

Try generating typings for your pod, that will help you write better TypeScript equivalent of Swift.