Making use of existing iOS code
[This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation]
Speed up development time by re-using your existing iOS code.
However, all is not lost if your iOS app relies on C++ code. As you know, iOS supports C++ development (you can compile C++ in Xcode alongside Objective-C). If you have been using C++, perhaps in a library or a framework, you can use this code very easily in your Windows app.
Here are some ways to re-use C++ code:
- Create a C++ Windows Store project (or Windows Phone Store app, or Universal Windows app), and drop in your C++ source code. If your code follows a Model View Controller or MVVM pattern, and so the UI is handled separately, this approach can work well.
Using a Windows Runtime Component to access C++ code
A Windows Runtime Component is essentially a DLL (a Dynamic Link Library) which can be used by a Windows Store app written in any supported language. This is perfect if your app requires a standalone library of high-performance code, for example, image processing or physics modeling.
Sharing other source code
If you are starting work on an iOS project rather than porting an existing one, there are several interesting options available to you that will make porting your app – or developing a Windows version in parallel – a lot more straightforward. For example, using a cross-platform tool such as Xamarin or MonoGame allows you to write a lot of your project directly in C#, making porting to Windows almost trivial.