'Set' does not have a member named 'anyObject." - Xcode 6.3

后端 未结 2 1963
忘掉有多难
忘掉有多难 2020-12-05 14:05

I\'m checking to see if an element has been selected.

func touchesBegan(touches: Set, withEvent event: UIEvent)
{
    // First, see if the g         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 14:49

    This would check for multiple touches in symbolsLayer

    override func touchesBegan(touches: Set, withEvent event: UIEvent)
    {
        // First, see if the game is in a paused state
        if !gamePaused
        {
            // Declare the touched symbol and its location on the screen
            for touch: AnyObject in touches {
                let location = (touch as! UITouch).locationInNode(symbolsLayer)
            }
        }
    }
    

提交回复
热议问题