I've got a xamarin forms solution with a pcl and a .Droid project. Now I also want to add ios to the solution. How do I do this. From the add dialog I can select add new project, but it seems to add a lot more....So the solution was first created without the ios checkmark....
btw. I'm using xamarin studio
Best regards
[Register ("AppDelegate")]
public class AppDelegate : FormsApplicationDelegate
{
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
Xamarin.Forms.Forms.Init();
LoadApplication (new App ());
return base.FinishedLaunching(application, launchOptions);
}
}
There is not a Xamarin.Forms project template that will do this out of the box. The Xamarin.Forms project templates are designed to be stand alone and ready to run after being created so they will always create a PCL project or a shared assets project.
Artur's answer, of creating a new empty iOS project, adding Xamarin.Forms NuGet package, then modifying the AppDelegate, is a good approach. Although it is missing:
If you compare that with the iOS project created using the empty project with the one created using the Xamarin.Forms project template they are slightly different. So an alternative to creating a new empty iOS project would be:
You could try adding a new Xamarin.Forms project to the existing solution using the New Project dialog without creating it separately. I would be careful doing this it may try to overwriting existing project files. If you have already done this then you should be able to remove the new PCL project it added and also the new UITests project it added. Then add a reference from the iOS project to your PCL project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With