tradingview/LightweightChartsIOS

applyOptions issue with SwiftUI

BSC-Spotter opened this issue · 2 comments

import LightweightCharts
let chart = LightweightCharts()
chart.applyOptions(options: ChartOptions(layout: LayoutOptions(backgroundColor: "#111111", textColor: "#FFFFFF")))

The code above used to work, but now it gives the following errors:

Cannot convert value of type 'ChartView.LayoutOptions' (aka 'PlatformViewRepresentableLayoutOptions') to expected argument type 'LayoutOptions?'
Extra argument 'textColor' in call
Initializer 'init(
:)' requires the types '_PlatformViewRepresentableLayoutOptions.Element' (aka '_PlatformViewRepresentableLayoutOptions') and 'String.Element' (aka 'Character') be equivalent

Would apperciate some help with this, again I'm using the library with SwiftUI, on the latest version

Might be a duplicate of #62, check my suggested workaround there.

Might be a duplicate of #62, check my suggested workaround there.

This solution worked