Hello, iOS – 快速入門Hello, iOS – Quickstart

本指南說明如何建立可將使用者輸入的英數字元電話號碼轉譯成數字電話號碼,然後再撥打該號碼的應用程式。This guide describes how to create an application that translates an alphanumeric phone number entered by the user into a numeric phone number, and then calls that number. 最終的應用程式看起來如下:The final application looks like this:

需求Requirements

使用 Xamarin 進行 iOS 開發需要:iOS development with Xamarin requires:

  • 執行 macOS High Sierra (10.13) 或更新版本的 Mac。A Mac running macOS High Sierra (10.13) or above.
  • App Store 安裝的最新版 Xcode 和 iOS SDK。Latest version of Xcode and iOS SDK installed from the App Store .

Xamarin.iOS 可與下列設定搭配運作:Xamarin.iOS works with the following setup:

  • 符合上述規格的最新版 Visual Studio for Mac。Latest version of Visual Studio for Mac that fits the above specifications.

Xamarin.iOS Mac 安裝指南提供逐步安裝指示The Xamarin.iOS Mac Installation guide is available for step-by-step installation instructions

Xamarin.iOS 可與下列設定搭配運作:Xamarin.iOS works with the following setup:

  • Windows 10 上的最新版 Visual Studio 2019 或 Visual Studio 2017 Community、Professional 或 Enterprise,並且已與符合上述規格的 Mac 組建主機配對。Latest version of Visual Studio 2019 or Visual Studio 2017 Community, Professional, or Enterprise on Windows 10, paired with a Mac build host that fits the above specifications.

Xamarin.iOS Windows 安裝指南會提供逐步安裝指示。The Xamarin.iOS Windows Installation guide is available for step-by-step installation instructions.

開始使用之前,請下載 Xamarin 應用程式圖示集Before getting started, download the Xamarin App Icons set.

Visual Studio for Mac 逐步解說Visual Studio for Mac Walkthrough

本逐步解說將說明如何建立名為 Phoneword 且可將英數字元電話號碼轉譯成數字電話號碼的應用程式。This walkthrough describes how to create an application called Phoneword that translates an alphanumeric phone number into a numeric phone number.

  1. 從 [Applications] 資料夾或 [Spotlight],啟動 Visual Studio for Mac:Launch Visual Studio for Mac from the Applications folder or Spotlight:

    在啟動畫面上,按一下 [新增專案] 以建立新 Xamarin.iOS 方案:On the Launch Screen, click New Project... to create a new Xamarin.iOS solution:

  2. 從 [新增方案] 對話方塊,選擇 [iOS] > [應用程式] > [單一檢視應用程式] 範本,並確定已選取 C#。From the New Solution dialog, choose the iOS > App > Single View Application template, ensuring that C# is selected. 按一下 [下一步]:Click Next:

  3. 設定應用程式。Configure the app. 在 [名稱] 中指定 Phoneword_iOS,並將其他選項維持為預設值。Give it the Name Phoneword_iOS, and leave everything else as default. 按一下 [下一步]:Click Next:

  4. 讓專案和方案名稱依原樣保留。Leave the Project and Solution Name as is. 在此處選擇專案的位置,或將其保留為預設值:Choose the location of the project here, or keep it as the default:

  5. 按一下 [建立] 以產生方案Click Create to make the Solution.

  6. Solution Pad 中按兩下 Main.storyboard 檔案加以開啟。Open the Main.storyboard file by double-clicking on it in the Solution Pad. 這提供以視覺化方式建立 UI 的方式:This provides a way to visually to create a UI:

    請注意,預設會啟用_大小類別_。Note that size classes are enabled by default. 若要深入了解它們,請參閱整合的分鏡腳本指南。Refer to the Unified Storyboards guide to learn more about them.

  7. 在 [Toolbox Pad] 中,在搜尋列中輸入「標籤」,然後將標籤拖曳至設計介面 (中央區域):In the Toolbox Pad, type "label" into the search bar and drag a Label onto the design surface (the area in the center):

    注意

    您隨時都可移至 [檢視] > [面板] 來顯示 Properties Pad工具箱You can bring up the Properties Pad or Toolbox at any time by navigating to View > Pads.

  8. 捕捉「拖曳控制項」的控點 (控制項周圍的圓形),然後將標籤加寬:Grab the handles of the Dragging Controls (the circles around the control) and make the label wider:

  9. 利用設計介面上選取的標籤,使用 Properties Pad 來將標籤文字屬性變更為 "Enter a Phoneword:"With the Label selected on the design surface, use the Properties Pad to change the Text property of the Label to "Enter a Phoneword:"

  10. 在工具箱內搜尋「文字欄位」,然後將文字欄位工具箱拖曳至設計介面,並放置於標籤下方。Search for “text field” inside the Toolbox and drag a Text Field from the Toolbox onto the design surface and place it under the Label. 調整寬度,直到文字欄位標籤等寬為止:Adjust the width until the Text Field is the same width as the Label:

  11. 在於設計介面上選取 [文字欄位] 的情況下,將 [文字欄位] 的 [名稱] 屬性 (位於 Properties Pad 的 [身分識別] 區段) 變更為 PhoneNumberText 並將 [文字] 屬性變更為 "1-855-XAMARIN":With the Text Field selected on the design surface, change the Text Field’s Name property in the Identity section of the Properties Pad to PhoneNumberText, and change the Text property to "1-855-XAMARIN":

  12. 按鈕工具箱拖曳至設計介面,並放置於文字欄位下方。Drag a Button from the Toolbox onto the design surface and place it under the Text Field. 調整寬度,使按鈕文字欄位標籤等寬:Adjust the width so the Button is as wide as the Text Field and Label:

  13. 利用設計介面上選取的按鈕,在 Properties Pad 的 [身分識別] 區段中,將名稱屬性變更為 TranslateButtonWith the Button selected on the design surface, change the Name property in the Identity section of the Properties Pad to TranslateButton. 標題屬性變更為 "Translate":Change the Title property to "Translate":

  14. 重複執行前兩個步驟,然後將按鈕工具箱拖曳至設計介面,並放置於第一個按鈕下方。Repeat the two steps above and drag a Button from the Toolbox onto the design surface and place it under the first Button. 調整寬度,使按鈕與第一個按鈕等寬:Adjust the width so the Button is as wide as the first Button:

  15. 利用設計介面上選取的第二個按鈕,在 Properties Pad 的 [身分識別] 區段中,將名稱屬性變更為 CallButtonWith the second Button selected on the design surface, change the Name property in the Identity section of the Properties Pad to CallButton. 標題屬性變更為 "Call":Change the Title property to "Call":

    瀏覽至 [檔案] > [儲存] 或按 ⌘ + s 來儲存變更。Save the changes by navigating to File > Save or by pressing ⌘ + s.

  16. 您必須將某些邏輯新增至應用程式,才能將電話號碼從英數字元轉譯為數字。Some logic needs to be added to the app to translate phone numbers from alphanumeric to numeric. 以滑鼠右鍵按一下 Solution Pad 中的 Phoneword_iOS 專案,然後選擇 [新增] > [新增檔案] 或按 ⌘ + n,將新檔案新增至專案:Add a new file to the Project by right clicking on the Phoneword_iOS Project in the Solution Pad and choosing Add > New File... or pressing ⌘ + n:

  17. 在 [新增檔案] 對話方塊中,選取 [一般] > [空類別] 並將新檔案命名為 PhoneTranslatorIn the New File dialog, select General > Empty Class and name the new file PhoneTranslator:

  18. 這會建立新的空白 C# 類別。This creates a new, empty C# class for us. 移除所有範本程式碼,並使用下列程式碼來取代:Remove all the template code and replace it with the following code:

    using System.Text;
    using System;
    
    namespace Phoneword_iOS
    {
        public static class PhoneTranslator
        {
            public static string ToNumber(string raw)
            {
                if (string.IsNullOrWhiteSpace(raw)) {
                    return "";
                } else {
                    raw = raw.ToUpperInvariant();
                }
    
                var newNumber = new StringBuilder();
                foreach (var c in raw)
                {
                    if (" -0123456789".Contains(c)) {
                        newNumber.Append(c);
                    } else {
                        var result = TranslateToNumber(c);
                        if (result != null) {
                            newNumber.Append(result);
                        }
                    }
                    // otherwise we've skipped a non-numeric char
                }
                return newNumber.ToString();
            }
    
            static bool Contains (this string keyString, char c)
            {
                return keyString.IndexOf(c) >= 0;
            }
    
            static int? TranslateToNumber(char c)
            {
                if ("ABC".Contains(c)) {
                    return 2;
                } else if ("DEF".Contains(c)) {
                    return 3;
                } else if ("GHI".Contains(c)) {
                    return 4;
                } else if ("JKL".Contains(c)) {
                    return 5;
                } else if ("MNO".Contains(c)) {
                    return 6;
                } else if ("PQRS".Contains(c)) {
                    return 7;
                } else if ("TUV".Contains(c)) {
                    return 8;
                } else if ("WXYZ".Contains(c)) {
                    return 9;
                }
                return null;
            }
        }
    }
    

    儲存 PhoneTranslator.cs 檔案並將它關閉。Save the PhoneTranslator.cs file and close it.

  19. 新增連接使用者介面的程式碼。Add code to wire up the user interface. 若要執行此作業,在 Solution Pad 中按兩下 ViewController.cs 加以開啟:To do this double-click on ViewController.cs in the Solution Pad to open it:

  20. 從連接 TranslateButton 開始。Begin by wiring up the TranslateButton. ViewController 類別中,尋找 ViewDidLoad 方法,並在 base.ViewDidLoad() 呼叫下方新增下列程式碼:In the ViewController class, find the ViewDidLoad method and add the following code beneath the base.ViewDidLoad() call:

    string translatedNumber = "";
    
    TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
        // Convert the phone number with text to a number
        // using PhoneTranslator.cs
        translatedNumber = PhoneTranslator.ToNumber(
            PhoneNumberText.Text);
    
        // Dismiss the keyboard if text field was tapped
        PhoneNumberText.ResignFirstResponder ();
    
        if (translatedNumber == "") {
            CallButton.SetTitle ("Call ", UIControlState.Normal);
            CallButton.Enabled = false;
        } else {
            CallButton.SetTitle ("Call " + translatedNumber,
                UIControlState.Normal);
            CallButton.Enabled = true;
        }
    };
    

    如果檔案的命名空間不同,請包含 using Phoneword_iOS;Include using Phoneword_iOS; if the file's namespace is different.

  21. 新增程式碼來回應按下第二個名為 CallButton 之按鈕的使用者。Add code to respond to the user pressing the second button, which is named CallButton. 將下列程式碼放置於 TranslateButton 的程式碼底下,然後在檔案頂端新增 using Foundation;Place the following code below the code for the TranslateButton and add using Foundation; to the top of the file:

        CallButton.TouchUpInside += (object sender, EventArgs e) => {
            // Use URL handler with tel: prefix to invoke Apple's Phone app...
            var url = new NSUrl ("tel:" + translatedNumber);
    
            // ...otherwise show an alert dialog
            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);
            }
        };
    
  22. 儲存變更,然後選擇 [組建] > [全部建立] 或按則是⌘ + B來建立應用程式。 如果應用程式進行編譯,則 IDE 頂端會出現成功訊息:Save the changes and then build the application by choosing Build > Build All or pressing ⌘ + B. If the application compiles, a success message will appear at the top of the IDE:

    如果發生錯誤,請完成上述步驟,並更正任何錯誤,直到應用程式建置成功為止。If there are errors, go through the previous steps and correct any mistakes until the application builds successfully.

  23. 最後,在 iOS 模擬器中測試應用程式。Finally, test the application in the iOS Simulator. 在 IDE 的左上角,從第一個下拉式清單中選擇 [偵錯],並從第二個下拉式清單中選擇 [iPhone XR iOS 12.0] (或其他可用的模擬器),然後按 [啟動] (類似 [播放] 按鈕的三角形按鈕):In the top left of the IDE, choose Debug from the first dropdown, and iPhone XR iOS 12.0 (or other available simulator) from the second dropdown, and press Start (the triangular button that resembles a Play button):

    注意

    目前因為 Apple 的需求,可能必須擁有開發憑證或簽署身分識別,才可針對裝置或模擬器建置您的程式碼。At present, due to a requirement from Apple, it may be necessary to have a development certificate or signing identity to build you code for device or simulator. 請依照裝置佈建指南中的步驟來設定此項。Follow the steps in the Device Provisioning guide to set this up.

  24. 這樣將會在 iOS 模擬器內啟動應用程式:This will launch the application inside the iOS Simulator:

    iOS 模擬器不支援撥打電話;將改為讓您在嘗試進行撥號時看到警示對話方塊:Phone calls are not supported in the iOS Simulator; instead, you will see an alert dialog when trying to place a call:

Visual Studio 逐步解說Visual Studio Walkthrough

本逐步解說將說明如何建立名為 Phoneword 且可將英數字元電話號碼轉譯成數字電話號碼的應用程式。This walkthrough describes how to create an application called Phoneword that translates an alphanumeric phone number into a numeric phone number.

注意

這個逐步解說會使用 Windows 10 虛擬機器上的 Visual Studio Enterprise 2017。This walkthrough uses Visual Studio Enterprise 2017 on a Windows 10 Virtual Machine. 您的設定可以與之不同,只要符合上述需求即可,但請注意,某些螢幕擷取畫面看起來可能與您的設定不同。Your set up can differ from this, as long as it meets the requirements above, but be aware that some screenshots may look different to your set up.

注意

繼續進行本逐步解說之前,您必須已經從 Visual Studio 連線到您的 Mac。Before proceeding with this walkthrough, you must have already connected to your Mac from Visual Studio. 這是因為 Xamarin.iOS 依賴 Apple 的工具來建置並啟動 iOS 設計工具和應用程式。This is because Xamarin.iOS relies on Apple's tooling to build and launch the iOS Designer and applications. 若要進行設定,請遵循與 Mac 配對指南中的步驟。To get set up, follow the steps in the Pair to Mac guide.

  1. 從 [開始] 功能表啟動 Visual Studio:Launch Visual Studio from the Start menu:

    選取 [檔案] > [新增] > [專案] > [Visual C#] > [iPhone 和 iPad] > [iOS 應用程式 (Xamarin)] 來建立新的 Xamarin.iOS 解決方案:Create a new Xamarin.iOS solution by selecting File > New > Project... > Visual C# > iPhone & iPad > iOS App (Xamarin):

    選取 iOS 應用程式(Xamarin)專案類型Select iOS App (Xamarin) project type

    在下一個出現的對話方塊中,選取 [單一檢視應用程式] 範本,然後按 [確定] 建立專案:In the next dialog that appears, select the Single View App template and press OK to create the project:

    選取單一視圖專案範本Select Single View project template

  2. 確認工具列中的 Xamarin Mac Agent 圖示為綠色。Confirm that the Xamarin Mac Agent icon in the toolbar is green.

    確認工具列中的 Xamarin Mac Agent 圖示為綠色

    如果它不是這樣,表示沒有任何連線連線到您的 Mac 組建主機,請依照設定指南中的步驟執行以連線。If it isn't, this means that there is no connection to your Mac build host, follow the steps in the configuration guide to get connected.

  3. 在 [方案總管] 中按兩下 Main.storyboard 檔案,以在 iOS 設計工具中開啟該檔案:Open the Main.storyboard file in the iOS Designer by double-clicking on it in the Solution Explorer:

  4. 開啟 [工具箱] 索引標籤,在搜尋列中輸入「標籤」,然後將標籤拖曳至設計介面 (中央區域):Open the Toolbox tab, type “label” into the search bar and drag a Label onto the design surface (the area in the center):

  5. 接著,抓住「拖曳控制項」的控點,然後將標籤加寬:Next, grab the handles of the Dragging Controls and make the label wider:

  6. 利用設計介面上選取的標籤,使用屬性視窗來將標籤文字屬性變更為 "Enter a Phoneword:"With the Label selected on the design surface, use the Properties Windows to change the Text property of the Label to "Enter a Phoneword:"

    注意

    您隨時都可移至 [檢視] 功能表來顯示 [屬性] 或 [工具箱]。You can bring up the Properties or Toolbox at any time by navigating to the View menu.

  7. 在工具箱內搜尋「文字欄位」,然後將文字欄位工具箱拖曳至設計介面,並放置於標籤下方。Search for “text field” inside the Toolbox and drag a Text Field from the Toolbox onto the design surface and place it under the Label. 調整寬度,直到文字欄位標籤等寬為止:Adjust the width until the Text Field is the same width as the Label:

  8. 利用設計介面上選取的文字欄位,在屬性 的 [身分識別] 區段中,將文字欄位名稱屬性變更為 PhoneNumberText,並將文字屬性變更為 "1-855-XAMARIN":With the Text Field selected on the design surface, change the Text Field’s Name property in the Identity section of the Properties to PhoneNumberText, and change the Text property to "1-855-XAMARIN":

  9. 按鈕工具箱拖曳至設計介面,並放置於文字欄位下方。Drag a Button from the Toolbox onto the design surface and place it under the Text Field. 調整寬度,使按鈕文字欄位標籤等寬:Adjust the width so the Button is as wide as the Text Field and Label:

  10. 利用設計介面上選取的按鈕,在屬性的 [身分識別] 區段中,將名稱屬性變更為 TranslateButtonWith the Button selected on the design surface, change the Name property in the Identity section of the Properties to TranslateButton. 標題屬性變更為 "Translate":Change the Title property to "Translate":

  11. 重複執行前兩個步驟,然後將按鈕工具箱拖曳至設計介面,並放置於第一個按鈕下方。Repeat the previous two steps and drag a Button from the Toolbox onto the design surface and place it under the first Button. 調整寬度,使按鈕與第一個按鈕等寬:Adjust the width so the Button is as wide as the first Button:

  12. 利用設計介面上選取的第二個按鈕,在屬性的 [身分識別] 區段中,將名稱屬性變更為 CallButtonWith the second Button selected on the design surface, change the Name property in the Identity section of the Properties to CallButton. 標題屬性變更為 "Call":Change the Title property to "Call":

    瀏覽至 [檔案] > [全部儲存] 或按 Ctrl + s 來儲存變更。Save the changes by navigating to File > Save All or by pressing Ctrl + s.

  13. 新增一些將電話號碼從英數字元轉譯為數字的程式碼。Add some code to translate phone numbers from alphanumeric to numeric. 若要執行此作業,先以滑鼠右鍵按一下 [方案總管] 中的 Phoneword 專案,然後選擇 [新增] > [新增項目] 或按 Ctrl + Shift + A,將新檔案新增至專案:To do this, first add a new file to the Project by right-clicking on the Phoneword Project in the Solution Explorer and choosing Add > New Item... or pressing Ctrl + Shift + A:

  14. 在 [新增項目] 對話方塊中 (以滑鼠右鍵按一下專案,選擇 [新增] > [新增項目]),選取 [Apple] > [類別] 並命名新的檔案 PhoneTranslatorIn the Add New Item dialog (right click on the project, choose Add > New Item...), select Apple > Class and name the new file PhoneTranslator:

    重要

    確定您選取的是圖示中具有 C# 的「類別」範本。Make sure that you select the 'class' template that has a C# in the icon. 否則您可能無法參考這個新類別。Otherwise you may not be able to reference this new class.

  15. 這會建立新的 C# 類別。This creates a new C# class. 移除所有範本程式碼,並使用下列程式碼來取代:Remove all the template code and replace it with the following code:

    using System.Text;
    using System;
    
    namespace Phoneword
    {
        public static class PhoneTranslator
        {
            public static string ToNumber(string raw)
            {
                if (string.IsNullOrWhiteSpace(raw)) {
                    return "";
                } else {
                    raw = raw.ToUpperInvariant();
                }
    
                var newNumber = new StringBuilder();
                foreach (var c in raw)
                {
                    if (" -0123456789".Contains(c)) {
                        newNumber.Append(c);
                    } else {
                        var result = TranslateToNumber(c);
                        if (result != null) {
                            newNumber.Append(result);
                        }
                    }
                    // otherwise we've skipped a non-numeric char
                }
                return newNumber.ToString();
            }
    
            static bool Contains (this string keyString, char c)
            {
                return keyString.IndexOf(c) >= 0;
            }
    
            static int? TranslateToNumber(char c)
            {
                if ("ABC".Contains(c)) {
                    return 2;
                } else if ("DEF".Contains(c)) {
                    return 3;
                } else if ("GHI".Contains(c)) {
                    return 4;
                } else if ("JKL".Contains(c)) {
                    return 5;
                } else if ("MNO".Contains(c)) {
                    return 6;
                } else if ("PQRS".Contains(c)) {
                    return 7;
                } else if ("TUV".Contains(c)) {
                    return 8;
                } else if ("WXYZ".Contains(c)) {
                    return 9;
                }
                return null;
            }
        }
    }
    

    儲存 PhoneTranslator.cs 檔案並將它關閉。Save the PhoneTranslator.cs file and close it.

  16. 在 [方案總管] 中按兩下 ViewController.cs 加以開啟,如此就能新增該邏輯來處理與按鈕的互動:Double-click on ViewController.cs in the Solution Explorer to open it, so that logic can be added to handles interactions with the buttons:

  17. 從連接 TranslateButton 開始。Begin by wiring up the TranslateButton. ViewController 類別中,尋找 ViewDidLoad 方法。In the ViewController class, find the ViewDidLoad method. 將下列按鈕程式碼新增至 ViewDidLoad 內 (位於 base.ViewDidLoad() 呼叫下方):Add the following button code inside ViewDidLoad, beneath the base.ViewDidLoad() call:

    string translatedNumber = "";
    
    TranslateButton.TouchUpInside += (object sender, EventArgs e) => {
    
        // Convert the phone number with text to a number
        // using PhoneTranslator.cs
        translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);
    
        // Dismiss the keyboard if text field was tapped
        PhoneNumberText.ResignFirstResponder ();
    
        if (translatedNumber == "") {
            CallButton.SetTitle ("Call", UIControlState.Normal);
            CallButton.Enabled = false;
            }
        else {
            CallButton.SetTitle ("Call " + translatedNumber, UIControlState.Normal);
            CallButton.Enabled = true;
            }
    };
    

    如果檔案的命名空間不同,請包含 using Phoneword;Include using Phoneword; if the file's namespace is different.

  18. 新增程式碼來回應按下第二個名為 CallButton 之按鈕的使用者。Add code to respond to the user pressing the second button, which is named CallButton. 將下列程式碼放置於 TranslateButton 的程式碼底下,然後在檔案頂端新增 using Foundation;Place the following code below the code for the TranslateButton and add using Foundation; to the top of the file:

    CallButton.TouchUpInside += (object sender, EventArgs e) => {
        var url = new NSUrl ("tel:" + translatedNumber);
    
            // Use URL handler with tel: prefix to invoke Apple's Phone app,
            // otherwise show an alert dialog
    
        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);
                    }
    };
    
  19. 儲存變更,然後選擇 [組建 > 組建方案] 或按Ctrl + Shift + B來建立應用程式。 如果應用程式編譯,IDE 底部會出現成功訊息:Save the changes, and then build the application by choosing Build > Build Solution or pressing Ctrl + Shift + B. If the application compiles, a success message will appear at the bottom of the IDE:

    如果發生錯誤,請完成上述步驟,並更正任何錯誤,直到應用程式建置成功為止。If there are errors, go through the previous steps and correct any mistakes until the application builds successfully.

  20. 最後,在遠端 iOS 模擬器中測試應用程式。Finally, test the application in the Remoted iOS Simulator. 在 IDE 工具列中,從下拉式功能表選擇 [偵錯] 和 [iPhone 8 Plus iOS x.x],然後按 [啟動] (類似 [播放] 按鈕的綠色三角形):In the IDE toolbar, choose Debug and iPhone 8 Plus iOS x.x from the drop down menus, and press Start (the green triangle that resembles a Play button):

  21. 這樣將會在 iOS 模擬器內啟動應用程式:This will launch the application inside the iOS Simulator:

    iOS 模擬器不支援撥打電話;將改為在嘗試進行撥號時顯示警示對話方塊:Phone calls are not supported in the iOS Simulator; instead, an alert dialog will display when trying to place a call:

恭喜您完成第一個 Xamarin.iOS 應用程式!Congratulations on completing your first Xamarin.iOS application!

現在可在 Hello, iOS 深度剖析中仔細分析本指南所示的工具與技能。Now it’s time to dissect the tools and skills shown in this guide in the Hello, iOS Deep Dive.