今天我用Swift 1.2更新了xcode我的代码在Swift 1.1上工作得很好但是当我更新时我得到了这个错误:
'Set'没有名为'anyObject'的成员
这是我的代码:
override public func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
let location:CGPoint? = touches.anyObject()?.locationInView(self)
if let loc = location {
if (!CGRectContainsPoint(ScaleRect(self.bounds, n: 2.0), loc)) {
self.highlighted = false
}
}
}
Run Code Online (Sandbox Code Playgroud)
你们有一个想法,我该如何解决这个问题?