Search code examples
sprite-kitios-simulatorswift2ios9touchesbegan

Touch detection doesn't work on simulator for iOS 9


I've updated Xcode to Xcode 7. Then my Swift project to Swift 2. At last I removed removed all warnings.

First scene display few SKLabel and few SKSpriteNode.

Using iOS Simulator, touch detection doesn't work under iOS 9 but is ok on iOS 8. A breakpoint put ontouchesBeganmethod show this method is not called.

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {

  // Breakpoint is set here
}

EDIT

Removing these messages does not solve anything.

Console display following warning 4 times, on iOS 9 only:

Error loading /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib:  dlopen(/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib, 262): no suitable image found.  Did find:
    /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib: mach-o, but not built for iOS simulator

Cannot find function pointer IOHIDLibFactory for factory 13AA9C44-6F1B-11D4-907C-0005028F18D5 in CFBundle/CFPlugIn 0x7ba430f0 </System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin> (bundle, not loaded)

Solution

  • Ok, problem solved!

    On StoryBoard, userInteractionEnabled property on the main Viewof the initial view controller was set to "NO". Changed it to "YES" solve the problem.

    This is weird because everything worked fine on iOS 8.