newtocoding
newtocoding

Reputation: 109

How do I fix this error in xcode 6.3 ios 8.3 Swift?

I get a whole bunch of errors when I updated Xcode to 6.3 and I fixed most of them except for this one. What am I doing wrong? Thank you!

 <NSObject> does not have a member named anyObject


 var touch: UITouch = touches.anyObject() as! UITouch

Upvotes: 2

Views: 718

Answers (1)

Rob
Rob

Reputation: 437382

It's now using Set<NSObject>, so you don't have anyObject anymore. But you can just grab the first item quite easily:

let touch = touches.first as! UITouch

Upvotes: 3

Related Questions