Updating Existing Apps to the Unified API
The Xamarin Classic API, which preceded the Unified API, has been deprecated.
- The last version of Xamarin.iOS to support the Classic API (monotouch.dll) was Xamarin.iOS 9.10.
- Xamarin.Mac still supports the Classic API, but it is no longer updated. Since it is deprecated, developers should move their applications to the Unified API.
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:
Fix any compiler warnings in your existing code, particularly those relating to deprecated APIs.
Use the Migration Tool built in to Visual Studio for Mac to update your project files and namespaces.
There are specific guides available for each product to help you update your apps to the Unified API and 64-bit support:
Existing Xamarin.iOS apps can be updated to the Unified API using the automated migration tool built in to Visual Studio for Mac. Some additional fixes may then be required, as explained in these instructions and tips.
Existing Xamarin.Mac apps can be updated to the Unified API using the automated migration tool built in to Visual Studio for Mac. Some additional fixes may then be required, as explained in these instructions and tips.
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.
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.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.