crashoverride777 / swifty-sk-scroll-view

A Swift library to add a UIScrollView to your SpriteKit scenes. This library is deprecated and no longer supported.
MIT License
60 stars 11 forks source link

Touches not working #4

Closed LAAMas closed 5 years ago

LAAMas commented 7 years ago

Hello! everything is working fine scroll-wise, but when i touch an object in the scene it freezes the scrollview, what do i do?

`override func touchesBegan(_ touches: Set, with event: UIEvent?) {

for touch: AnyObject in touches {

    let pointOfTouch = touch.location(in: self)
    let tappedNode = atPoint(pointOfTouch)
    let tappedNodeName = tappedNode.name

    if tappedNodeName == "backButton" {
        scrollView?.removeFromSuperview()
        backButton.setScale(0.8)

        let sceneToMoveTo = MainMenuScene(size: self.size)
        sceneToMoveTo.scaleMode = self.scaleMode
        //let sceneTransition = SKTransition.fade(withDuration: 0.2)
        self.view!.presentScene(sceneToMoveTo)
        scene?.scaleMode = .aspectFill
    }

    if tappedNodeName == "page1ScrollView" {
        scrollView?.removeFromSuperview()
        page1ScrollView.setScale(0.9)

`