Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CombinedChartView - EXC_BAD_ACCESS with doubleTapToZoomEnabled #3614

Description

@MartinPerry

What did you do?

I have initialized chart with this code:

class ChartWrapper: ChartViewDelegate {

   private var chart: BarLineChartViewBase!

   func initChart() {
     let lc: CombinedChartView = CombinedChartView()
     lc.drawOrder = [DrawOrder.candle.rawValue,
                               DrawOrder.line.rawValue]
     lc.backgroundColor = UIColor.white

     chart = lc
   
     chart.delegate = self
        
     chart.dragEnabled = false
     chart.setScaleEnabled(false)
     chart.pinchZoomEnabled = false
     chart.highlightPerTapEnabled = false
     chart.doubleTapToZoomEnabled = false

     chart.leftAxis.enabled = false
     chart.rightAxis.enabled = false
     chart.legend.enabled = false
     chart.chartDescription?.enabled = false
     ... other code
  }

What did you expect to happen?

I have migrated from directly embeding Charts workspace into my worskapce to Carthage and linked it with the latest Charts 3.1.1. Before, with workspace directly in my project, all was running fine, now the crash occurs.

What happened instead?

The code crashes on line with chart.doubleTapToZoomEnabled = false

I have tried to comment out that line, but in that case it crash later on other lines.

In debug console, I can see:
Can't select by touch. No data set.
Charts was compiled with optimization - stepping may behave oddly; variables may not be available.

Charts Environment

Charts version/Branch/Commit Number: 3.1.1.
Xcode version: 9.4.1
Swift version: 4
Platform(s) running Charts: iOS
macOS version running Xcode: 10.13.6

Carthage related ?

As it turns out, this is carthage problem. If I manually embed entire Charts workspace into mine and build Framework together with my project, all is running fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions