zemirco / swift-linechart

Line Chart library for iOS written in Swift
602 stars 68 forks source link

Errors when Compile Sample #19

Closed mitsus closed 9 years ago

mitsus commented 9 years ago

Hi Zemirco, i've a problem when try to compile your sample. See my screen Shot schermata 2015-04-08 alle 23 37 34

riccardoch commented 9 years ago

Same problem for me!

rakaramos commented 9 years ago

I've same issue. Here's what I've did to fix those:

Coordinate struct needs a 'init()' in order to fix [CGFloat] is not convertible to Range. So you'll end up with:

public struct Coordinate {
    init () {}
    // public
    public var labels: Labels = Labels()
    public var grid: Grid = Grid()
    public var axis: Axis = Axis()

    // private
    private var linear: LinearScale!
    private var scale: ((CGFloat) -> CGFloat)!
    private var invert: ((CGFloat) -> CGFloat)!
    private var ticks: (CGFloat, CGFloat, CGFloat)!
}

'Set' error is easier: Change this:

override public func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {

With

override public func touchesEnded(touches: NSSet, withEvent event: UIEvent) {
zemirco commented 9 years ago

just use latest xcode

mitsus commented 9 years ago

Hi rakaramos, i've follow your instructions...now i've reduce errors to two. I work with Xcode 6.2 Please see: schermata 2015-04-11 alle 00 28 04

Hi zemirco, please can you reopen this issue? Thanks and Regards

rakaramos commented 9 years ago

mitsus, Sorry, I've forgot to mention those last fixes. Just change it from:

count(data)

to:

data.count