Updating Existing Apps to the Unified API

Related Articles:

Let us know how you feel about this.


0/250
Thanks for the feedback!

last updated: 2016-04

Classic Profile Deprecation: As new platforms are added in Xamarin.iOS we are starting to gradually deprecate features from the classic profile (monotouch.dll). For example, the non-NRC (new-ref-count) option was removed. NRC has always been enabled for all unified applications (i.e. non-NRC was never an option) and has no known issues. Future releases will remove the option of using Boehm as the garbage collector. This was also an option never available to unified applications. The complete removal of classic support is scheduled for next fall with the release of Xamarin.iOS 10.0.

How to Update Your Apps

Xamarin University has a freely available video on Upgrading to the iOS Unified API. Visit Xamarin University Lightning Lectures to watch!

There are three steps to update your apps:

  1. Fix any compiler warnings in your existing code, particularly those relating to deprecated APIs.

  2. Use the Migration Tool built in to Xamarin Studio to update your project files and namespaces.

  3. Fix remaining compiler errors relating to the new 64-types and other APIs that have changed. Check out these tips for additional information on manual updates that might be required.

There are specific guides available for each product to help you update your apps to the Unified API and 64-bit support:

Xamarin.iOS apps

Existing Xamarin.iOS apps can be updated to the Unified API using the automated migration tool built in to Xamarin Studio. Some additional fixes may then be required, as explained in these instructions and tips.

Xamarin.Mac apps

Existing Xamarin.Mac apps can be updated to the Unified API using the automated migration tool built in to Xamarin Studio. Some additional fixes may then be required, as explained in these instructions and tips.

Xamarin.Forms apps

Follow these instructions to update an existing Xamarin.Forms solution with an iOS project to use the Unified API. Unified API support is only available in Xamarin.Forms 1.3 and later, so the instructions also explain how to update your Xamarin.Forms app to version 1.3. These tips may help updating any native iOS code in custom renderers or dependency services.

Working with Native Types in Cross-Platform Apps

This article covers using the new iOS Unified API Native types (nint, nuint, nfloat) in a cross-platform application where code is shared with non-iOS devices such as Android or Windows Phone OSes. It provides insight into when the Native types should be used and provides several possible solutions to cases where the new type must be used with cross-platform code.

Update Bindings to the Unified API

Customers that have created bindings to Objective-C libraries will need to update the binding project to reflect changes in the underlying API (where some types will now be 64-bit). Follow these instructions to update an existing Binding Project to support the Unified API.

Update Components to the Unified API

Components written for the Xamarin Component Store, as well as NuGet packages that support Xamarin projects, also need to be updated. Follow this guidance to update Components to support the Unified API.

We recommend that Components and NuGet packages are updated so that they can support both the Classic and Unified APIs. This is explained in the guide.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.