Делаю проект по примеру
https://docs.microsoft.com/en-us/xamarin/ios/get-s... нажимаю на кнопки call либо translate и прилага тупо зависает
public partial class ViewController : UIViewController
{
public ViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
string translatedNumber = "";
TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
translatedNumber = PhoneTranslator.ToNumber(
PhoneNumberText.Text);
PhoneNumberText.ResignFirstResponder();
if (translatedNumber == "")
{
CallButton.SetTitle("Call ", UIControlState.Normal);
CallButton.Enabled = false;
}
else
{
CallButton.SetTitle("Call " + translatedNumber,
UIControlState.Normal);
CallButton.Enabled = true;
}
};
CallButton.TouchUpInside += (object sender, EventArgs e) => {
var url = new NSUrl("tel:" + translatedNumber);
if (!UIApplication.SharedApplication.OpenUrl(url))
{
var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
PresentViewController(alert, true, null);
}
};
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
}