Created
February 23, 2012 03:40
-
-
Save nicwise/1889882 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BTPinchGestureRecognizer : UIPinchGestureRecognizer | |
{ | |
public BTPinchGestureRecognizer(NSObject target, Selector action) : base(target, action) | |
{ | |
ShouldReceiveTouch += (sender, touch) => { | |
//if (touch.View is UISlider || touch.View is MPVolumeView) return false; | |
return true; | |
}; | |
} | |
} | |
public class OverviewDialogViewController : DialogViewController | |
{ | |
public OverviewDialogViewController () : base() | |
{ | |
Style = UITableViewStyle.Plain; | |
} | |
public override void LoadView () | |
{ | |
base.LoadView (); | |
//setup stuff | |
//most likely you can just use a UIPinchGestureRecognizer not the custom one... I was using custom for swipes.... | |
TableView.AddGestureRecognizer(new BTPinchGestureRecognizer(this, new Selector("pinch"))); | |
and the pinch handler: | |
[Export("pinch")] | |
public void Pinch(UIPinchGestureRecognizer sender) | |
{ | |
if (sender.State == UIGestureRecognizerState.Ended) | |
{ | |
SystemSound.Vibrate.PlaySystemSound(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment