1

I was spacing out while starting a new project to port one of my Obj-C/SpriteKit apps over to Swift and started to add a touch for loop within touchesMoved. My mistake, but the weird issue is that I get "SourceKitService Terminated" and Xcode completely bugs out.

override func touchesMoved(touches: NSSet!, withEvent event: UIEvent!) {
    for touch: AnyObject in touches {

    }
} 

Specifically, this happens the moment I begin to type "touches" in the for loop. Entering "for touch: AnyObject in" everything is still fine. As soon as I continue to type "touches"... SourceKitService Terminated.

I get that this should be an error, but why is Xcode completely freaking out because of this?

Shruti Thombre
  • 989
  • 4
  • 11
  • 27
Christian
  • 336
  • 1
  • 4
  • 16

2 Answers2

1

You have a syntax error so the SourceKitService is throwing up. It worked for me when I did

override func touchesMoved(touches: NSSet!, withEvent event: UIEvent!) {
    for touch : AnyObject in touches.allObjects{
        print(touch)

    }
}

Not sure if this fixes your issue. Please be kind we're all swift newbs :)

Alex Reynolds
  • 6,264
  • 4
  • 26
  • 42
0

I was having a problem with xcode 6 beta 6. I finally changed the iOS Deployment Target from 7.0 to 7.1 and my problem went away!

JTerry
  • 139
  • 8