Search code examples
swiftcgcontextios-charts

Warning with CGContextSetLineDash


I'm trying to implement graph in my app. I had used this graph library in my app. It's working properly, but it shows following warning for 15-20 time in console.

CGContextSetLineDash: invalid dash array: at least one element must be non-zero.

Solution

  • You should post what are the argument values.

    As I can assume from the error message, your arguments has 0 and is not allowed. Read CGContextSetLineDash about the dash options.

    // This dash shouldn't be zero
    line1.lineDashLengths = [0, 0]