Skip to content

Instantly share code, notes, and snippets.

@prashantvc
Last active December 24, 2015 07:19
Show Gist options
  • Save prashantvc/6762824 to your computer and use it in GitHub Desktop.
Save prashantvc/6762824 to your computer and use it in GitHub Desktop.
int ShowModalAletView (string title, string message, params string[] buttons)
{
int clicked = -1;
var alertView = new UIAlertView (title, message, null, null, buttons);
alertView.Show ();
bool done = false;
alertView.Clicked += (sender, buttonArgs) => {
Console.WriteLine ("User clicked on {0}", buttonArgs.ButtonIndex);
clicked = buttonArgs.ButtonIndex;
};
while (clicked == -1){
NSRunLoop.Current.RunUntil (NSDate.FromTimeIntervalSinceNow (0.5));
}
return clicked;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment