Demo entry 3602286

swift test

   

Submitted by daniel bonates on Feb 13, 2016 at 01:16
Language: Swift. Code size: 588 Bytes.

func swiped(sender:UIGestureRecognizer) {
        
        if let swipe = sender as? UISwipeGestureRecognizer {
            switch swipe.direction {
            case UISwipeGestureRecognizerDirection.Up:
                pad -= stepChange
                if pad < 0 { pad = 0 }
            case UISwipeGestureRecognizerDirection.Down:
                if pad > self.v1.bounds.height { break }
                pad += stepChange
            default:
                print("did you meant to swipe?!")
            }
            
            updateConstraints()

        }
    }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).