2015-09-05 65 views

回答

4

在你UIGestureRecognizerDelegate

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool { 
    switch gestureRecognizer { 
    case leftTapGesture: 
     return touch.locationInView(theView).x < 50 
    case rightTapGesture: 
     return touch.locationInView(theView).x >= 50 
    default: 
     // cannot be here 
     return false 
    } 
} 
+0

如何調用該函數在viewDidLoad中 – AAA

+0

這是連接到手勢,並呼籲水龍頭,你永遠不直接調用此 – Yariv

相關問題