I got this error message after upgrade from XCode 6.2 to XCode 7.0.1.
/Users/ZERO/Documents/Xcode/XXXXX/Library/SegmentedControl/SegmentedControl.swift:124:10: Method 'beginTrackingWithTouch(:withEvent:)' with Objective-C selector 'beginTrackingWithTouch:withEvent:' conflicts with method 'beginTrackingWithTouch(:withEvent:)' from superclass 'UIControl' with the same Objective-C selector
My code:
func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) -> Bool {
let location = touch.locationInView(self)
var calculatedIndex : Int?
for (index, item) in labels.enumerate() {
if item.frame.contains(location) {
calculatedIndex = index
}
}
if calculatedIndex != nil {
selectedIndex = calculatedIndex!
sendActionsForControlEvents(.ValueChanged)
}
return false
}