菜鸟教程小白 发表于 2022-12-11 17:28:59

ios - SwiftChart 库不适用于 Swift 3.0


                                            <p><p>我用过<a href="https://github.com/gpbl/SwiftChart?ref=ioscookies.com" rel="noreferrer noopener nofollow">SwiftChart</a>实现如下图所示的折线图和面积图 <a href="/image/dTGhd.png" rel="noreferrer noopener nofollow"><img src="/image/dTGhd.png" alt="Line and chart area"/></a> . </p>

<p>它适用于 Xcode 7.3。现在正在将我的代码移植到 iOS 10,以便将代码转换为 Swift 3.0。我收到以下错误:</p>

<p>U</p>

<pre><code>CGPathMoveToPoint(area, nil, CGFloat(xValues), zero)

for i in 0..&lt;xValues.count {
    CGPathAddLineToPoint(area, nil, CGFloat(xValues), CGFloat(yValues))
}

CGPathAddLineToPoint(area, nil, CGFloat(xValues.last!), zero)
</code></pre>

<p>和</p>

<pre><code>if labels != 0 {
    // Horizontal grid for 0 is not dashed\
    CGContextSetLineDash(context,phase:0,lengths:,count:1)
   // CGContextSetLineDash(context, 0, , 1)
} else {
    CGContextSetLineDash(context, 0, nil, 0)
}
</code></pre>

<p>请帮我解决这个问题</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p><a href="https://github.com/gpbl/SwiftChart?ref=ioscookies.com" rel="noreferrer noopener nofollow">SwiftChart</a> 的最新更新修复了上面提到的问题。请将您的 swift 图表库代码更新为最新的</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - SwiftChart 库不适用于 Swift 3.0,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39423971/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39423971/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - SwiftChart 库不适用于 Swift 3.0