Updating Existing Apps to the Unified API
Important
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
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.
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 Visual Studio for Mac. 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 Visual Studio for Mac. 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.