- Open Finder.
- Click Applications in the left-hand pane.
- Now, double-click on the Visual Studio icon.
- Now, click on Open, locate the Chapter8.Xamarin solution, and open it.
- The Solution Explorer should look like this:
- Now, control (^) + click on the Chapter8.Xamarin label and select Add | New Project.
- In the New Project dialog box, scroll down the left-hand pane till you see the Multi Platform section.
- Click on Library and select .NET Standard Library under General in the right-hand pane. Also make sure C# is selected:
- Click Next.
- Select Target Framework: as .NET Standard 2.0 and click Next:
- In the Project Name: textbox, type Chapter8.Xamarin.iOSLib as the name and leave the rest:
- Click Create.
- Now, the Solution Explorer should look like this:
- Select the Class1.cs label and press command + R to rename.
- Rename it HelloLib.cs.
- Make sure you change the class name as well from Class1 to HelloLib.
- Now, inside the HelloLib class, add the following code:
public string SayHello(string yourName)
{
return $"Hello {yourName}, Greetings from iOS";
}
- Click Build | Build All to check that all syntax is correct.
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.