Unified API Migration Example with the Dutch Spelling App

Mike James

Earlier this month, I recorded a webinar showing an overview of what the new Unified API means for developers and how you can seamlessly migrate your existing apps to guarantee their longevity. As we approach Apple’s deadline for supporting 64-bit in new app submissions, iOS developers around the world are ensuring their apps will continue to be accepted into the App Store by making the necessary changes to enable the support. Xamarin developers will need to follow suit by making sure they’ve updated their apps to use the new Unified API, which replaces the Classic API.

During the webinar I demonstrated the migration process on an app I developed some time ago that needed to be migrated to the Unified API. The app in question is called Dutch Spelling, a language learning app originally built in just 2 hours! It’s available to download from GitHub in order for you to follow the guide I’ve created for you below.

screenshots

Dutch Spelling’s business logic is contained within a library that is referenced from the language specific project. This approach allows me to add new features and fix bugs in only one project, while maintaining the language based content of the app separate.

Migration to Unified.

The migration process from the Classic API to our new Unified API couldn’t be any simpler. If you’ve cloned Dutch Spelling onto your machines, you’ll notice that it currently has two branches. The master branch is our Unified API and the second branch uses the Classic API. I’ve taken this approach with my other iOS apps such as My StepCounter, as it allows you to see the differences in the solution before and after migration.

You’ll want to ensure you’re on the Classic-API branch before starting the migration. Open the project in your favorite IDE (in my case it’s Xamarin Studio) and double check that everything builds as expected. If it doesn’t, please create an issue on GitHub for me to investigate.

Migration Tool

Let’s select the ‘Dutch Spelling’ project and click ‘Project’ > ‘Migrate to Xamarin.iOS Unified API’. You’ll be presented with a dialog explaining what the migration tool will do to your project. You will want to click ‘Migrate to Unified API’.

Xamarin Studio

Visual Studio Screen Shot 2015-01-26 at 10.15.58 AM

With this, your project will now reference Xamarin.iOS instead of MonoTouch and our Spelling.Core project will be marked as incompatible. This project is now using the Unified API and we don’t need to touch it again, however, we will now need to run the same process on Spelling.Core, and then we’re done.

If the migration tool doesn’t successfully migrate your project, or you’ve got a complex situation, you can manually migrate to the Unified API. Our documentation team has written a fantastic step-by-step migration guide.

Learn More

To learn more about the Unified API be sure to read through the full documentation. To see a full migration of Dutch Spelling in action, check out my Unified API Webinar recording online.

0 comments

Discussion is closed.

Feedback usabilla icon