2015-05-29 83 views
0

当我从视图控制器添加UIImageview时,我想使touchesbegan方法处于非活动状态,直到按下uiimage。Touchesbegan方法从视图控制器处于非活动状态

现在我已经设置了一切,我只需要知道如何通过在viewcontroller中设置代码(仅)来防止gamescene注意到触摸。

任何人都知道如何?

GameScene.paused = true // this pauses the game, but the touchesbegan method is still active! 

回答

0

您可以设置userInteractionEnabled对视图假要禁用触摸或者你可以做的触摸开始时检查的起因是这样:

if GameScene.paused == true { 
    return 
}