0
votes

I'm trying to develop an application that uses bar charts by using iOS Charts. I just set up cocoapods file, imported the Charts.framework and compiled the project, and I got the following error:

/Users/i3t/Desktop/AppAdmin/eCardFidAdmin/Pods/Charts/Source/Charts/Utils/ChartPlatform.swift:111:30: Method does not override any method from its superclass

This error is happening in this function:

public final override func touchesCancelled(touches: Set<NSUITouch>, withEvent event: NSUIEvent?)
{
    self.nsuiTouchesCancelled(touches, withEvent: event)
}

I remove the override statement and I got this new error:

/Users/i3t/Desktop/AppAdmin/eCardFidAdmin/Pods/Charts/Source/Charts/Utils/ChartPlatform.swift:111:21: Method 'touchesCancelled(:withEvent:)' with Objective-C selector 'touchesCancelled:withEvent:' conflicts with method 'touchesCancelled(:withEvent:)' from superclass 'UIResponder' with the same Objective-C selector

Someone knows how can I fix that?

2
Assuming this is Swift 3 the signature was changed to with event: instead of withEvent event:dan
Does not work yet. It is strange, the other functions has no problems, just the function "touchesCancelled"Breno Macena

2 Answers

0
votes

You are not subclassing it properly use

import Charts

Your class has to be subclassed from ChartPlatform

You can only override if you are subclassing otherwise it wont work

0
votes

I have the same problem and I fixed it changing the parameter touches: as an optional like its parent function. (swift 2.2)

public final override func touchesCancelled(touches: Set<NSUITouch>?, withEvent event: NSUIEvent?)
    {
        self.nsuiTouchesCancelled(touches, withEvent: event)
    }