Question: now with swift 2.0, IOS 8.3 this code doesn't work anymore.
'Set' does not have a member named 'allObjects'

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

    var touch: UITouch = event.allTouches()?.allObjects.last as UITouch!
}

```

I tried a lot of stuffs but nothing seems to work, any idea ?

Thanks

Answer: 
Swift 1.2 has introduced a native `Set` type, but unlike `NSSet` it doesn't have the `anyObject` method. You have a couple of options. You can use the `first()` method or you can take advantage of the ability to bridge a Swift Set to NSSet -

```
let touch = touches.first() as? UITouch

```

or

```
let touchesSet=touches as NSSet
let touch=touchesSet.anyObject() as? UITouch

```
I've noticed that, too. I'm not sure if this is the actual alternation for the original code these days... I'm sure it isn't. But I've simply changed that code to this:

```
(touches: NSObject, withEvent event: UIEvent)

```

Sorry if that doesn't work for you. It's been working for me perfectly fine.