Eleven months ago, Microsoft introduced its Windows Bridge for iOS, otherwise known as Project Islandwood. It is an open source tool to port iOS apps to Windows freely available on GitHub. Since then, the project has experienced considerable downloads and Microsoft has made quite a bit of changes. All of this is documented in the Windows blog.
According to the company, developers have been requesting complete API coverage of Microsoft's UIKit implementation. UIKit is a set of 30 modular interface components used in iOS's Cocoa Touch, among other platforms, and it's difficult to modify UIKit because that would mean modifying hundreds of classes.
Plus, Windows has the same functionality through XAML on Windows, so it would essentially be reinventing the wheel. However, Microsoft decided to create a clear method to migrate UIKit-based UIs to XAML. As a result, Project Islandwood gains the following improvements:
- Faster bring up of iOS controls, so more of UIKit is available to you
- An improved touch-input model for more performant event handling
- Much improved support for accessibility and localization
- Better test automation, resulting in more stable and high-quality controls
- Much improved integration with and leveraging of Windows’ UI framework, XAML
Microsoft also outlined what's next for Project Islandwood, stating that it continues to preserve the UIKit functionality as much as possible. For example, a programmer may use UIButton, but it would call Microsoft's implementation and not Apple's.
"This approach offers a number of advantages. For one, it greatly reduces the amount of work it takes to bring up on Windows the UIKit classes iOS developers depend on. For another, it dramatically increases what the bridge is able to offer in terms of accessibility and localization, not to mention performance, stability, and polish. Lastly, the new approach allows us to take advantage of test automation designed for XAML, which will help to raise the quality bar of our UI frameworks and prevent regressions," the company said in the blog.
Microsoft acknowledges that perfect recreations of all of UIKit's functionality are no longer possible, but the company will try to map as much of UIKit's functionality to the corresponding XAML features as possible.
For instance, Microsoft removed its implementation of UITextField, which was designed to mimic iOS’s UITextField as closely as possible even though it was incomplete, and replaced it with a version of XAML’s TextBox class that was wrapped in UITextField’s APIs.
"By plumbing UITextField’s methods and properties through to their respective counterparts in XAML’s TextBox, we were able to preserve virtually all of the UITextField functionality using an existing XAML control," Microsoft wrote.
As part of the update, Microsoft is introducing a new tool called "Xib2Xaml," which will convert Storyboard and XIB files created in Xcode's Interface Builder into Windows-compatible XAML files so that they can be directly edited in Visual Studio.
In the past, making changes to your XIBs and Storyboards meant going back to Xcode on a Mac and running through the whole bridge workflow again, since there was no native support for editing XIBs in Visual Studio. The new Xib2Xaml tool now makes XIB editing in VS possible.