Home 4 Forums Swift and Sprite Kit UIGestureRecognizer

This topic contains 1 reply, has 2 voices, and was last updated by  Justin 1 year ago.

  • November 11, 2017 at 5:37 pm #175987

    I have been trying to add UIGesturerecognizer to my app,I have been experiencing some problems as on Xcode 9
    it keeps telling me UIGestureRecognizer has no member ‘direction’ and this the code. Its specifically referring to this line swipeRightRec.direction = .right

    let swipeRightRec= UIGestureRecognizer()

    swipeRightRec.addTarget(self, action: #selector(GameScene.swipedRight) )
    swipeRightRec.direction = .right

    func swipeRight()

  • November 12, 2017 at 9:40 pm #176028

    Sure, just change UIGesturerecognizer to UISwipeGestureRecognizer

The topic ‘UIGestureRecognizer’ is closed to new replies.