Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Gesture

Atsuya Sato edited this page Nov 30, 2018 · 6 revisions

Gesture


fingerPressed: Bool

Available

iOS

Examples

func draw() {
    if fingerPressed {
        ellipse(touchX, touchY, 10, 10)
    }
}

Description


touchX: CGFloat

Available

iOS

Examples

func draw() {
    if fingerPressed {
        ellipse(touchX, touchY, 10, 10)
    }
}

Description


touchY: CGFloat

Available

iOS

Examples

func draw() {
    if fingerPressed {
        ellipse(touchX, touchY, 10, 10)
    }
}

Description


touches: Set<CGPoint>

Available

iOS

Examples

func draw() {
    if fingerPressed {
        for touch in touches {
            ellipse(touch.x, touch.y, 10, 10)
        }
    }
}

Description


mousePressed: Bool

Available

OSX

Examples

func draw() {
    if mousePressed {
        ellipse(mouseX, mouseY, 10, 10)
    }
}

Description


mouseX: CGFloat

Available

OSX

Examples

func draw() {
    if mousePressed {
        ellipse(mouseX, mouseY, 10, 10)
    }
}

Description


mouseY: CGFloat

Available

OSX

Examples

func draw() {
    if mousePressed {
        ellipse(mouseX, mouseY, 10, 10)
    }
}

Description


func didTap()

Available

iOS

Examples

func didTap() {
    // Called when tapped
}

Description


func didRelease()

Available

iOS

Examples

func didTap() {
    // Called when release
}

Description


func didDrag()

Available

iOS

Examples

func didDrag() {
    // Called when dragged
}

Description


func didSwipe(direction: UISwipeGestureRecognizer.Direction)

Available

iOS

Examples

func didSwipe(direction: UISwipeGestureRecognizer.Direction) {
    // Called when swiped
}

Description


func didPinch(scale: CGFloat, velocity: CGFloat)

Available

iOS

Examples

func didPinch(scale: CGFloat, velocity: CGFloat) {
    // Called when pinched
}

Description


func didRotate(rotation: CGFloat, velocity: CGFloat)

Available

iOS

Examples

func didRotate(rotation: CGFloat, velocity: CGFloat) {
    // Called when pinched
}

Description


func didLongPress()

Available

iOS

Examples

func didLongPress() {
    // Called when long pressed
}

Description


func didClick()

Available

OSX

Examples

func didClick() {
    // Called when clicked
}

Description


func didRelease()

Available

OSX

Examples

func didRelease() {
    // Called when released
}

Description


func didDrag()

Available

OSX

Examples

func didDrag() {
    // Called when dragged
}

Description


func didMove()

Available

OSX

Examples

func didMove() {
    // Called when moved
}

Description


func didMagnify(magnification: CGFloat)

Available

OSX

Examples

func didMagnify(magnification: CGFloat) {
    // Called when magnified
}

Description


func didRotate(rotation: CGFloat, inDegrees: CGFloat)

Available

OSX

Examples

func didRotate(rotation: CGFloat, inDegrees: CGFloat) {
    // Called when rotated
}

Description


func didPress()

Available

OSX

Examples

func didPress() {
    // Called when pressed
}

Description


func didScroll(x: CGFloat, y: CGFloat)

Available

OSX

Examples

func didScroll(x: CGFloat, y: CGFloat) {
    // Called when scrolled
}

Description


Clone this wiki locally