Making use of existing iOS code
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.
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.
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.
- Code libraries, toolkits and other sources of help
- Blog post on building your own Windows Runtime components for Windows Store apps
- Creating Windows Runtime Components in C++
- Port from OpenGL ES 2.0 to Direct3D 11
- Guide to Porting an OpenGL ES 2.0 Application from iOS to Windows 8