crashoverride777/swifty-sk-scroll-view

Touches not working

Closed this issue · 0 comments

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)

`