Windows Bridge for iOS updated with CoreFoundation and improved layout API support
(Image Credit: iStockPhoto/RoschetzkyIstockPhoto)
Microsoft's open-source tool for porting iOS applications to Windows has been updated with improved support for several widely-used iOS layout APIs and integration with the official CoreFoundation framework.
The biggest announcement of the Windows Bridge for iOS for many developers will be the integration with CoreFoundation. The framework provides the structure of many iOS apps through classes such as NSString and NSArray; which if you have some development experience with Apple's mobile platform you're sure to have come across.
Apple made the framework open-source after doing the same with their Swift programming language in December. Microsoft's iOS bridge team merged the official, canonical implementation of CoreFoundation into the WinObjC code base to ensure the complete CoreFoundation/Foundation framework is now available for use in the bridge.
A good app can be ruined by a bad layout, but Microsoft ensured it was easier to avoid with APIs and tools such as UIKit and Xib2Nib – both of which are supported in Windows Bridge for iOS along with some of the most widely-used APIs in Apple's own Auto Layout mechanism. As of this update, two new classes known as NSLayoutAnchor and UILayoutGuide are now supported.
Nick Gerard, Program Manager at Microsoft, wrote on the Windows blog: "In the past, many common Auto Layout scenarios required the use of dummy views; for example, if you wanted to use constraints to define the size of empty space between two other views, you had to fill that space with a dummy view. While this works (and the use of this technique is widespread), it’s generally considered bad practice, as you’re introducing a lot of unnecessary overhead by instantiating an entire UIView object simply to represent empty space. Additionally, constraint-based layouts can quickly get messy and difficult to parse, especially if you have many sibling views inside a larger container,"
"The UILayoutGuide class is designed to solve these problems. Wherever you would have used a dummy view in your constraint-based layout previously, you can now use an instance of the much lighter-weight UILayoutGuide class. And since layout guides can contain other views and controls, you can also use them to encapsulate different parts of your view and break your layouts up into modular – and much more manageable – chunks."
Microsoft's updates to Windows Bridge for iOS make it ever more feasible and easy to port your existing iOS applications into UWP apps. For some examples of how to make use of the updates, Microsoft has even launched a repo of samples on Github to help you get started.
Two different types of projects can be found on the repo – bite-sized samples and full apps. Bite-size samples demonstrate how to use Windows 10 features directly from Objective-C including Live Tiles and popping toast notifications using the native Objective-C code and syntax. Soon, more samples will be added to showcase Cortana, in-app purchases, maps, and push notifications.
The full apps section offers complete XCode projects for more complex and fully-featured apps that are compatible with the bridge. At launch, this will include the To Do list and Calculator apps previously featured in tutorial blog posts on the Building Apps for Windows blog.
You can download the latest release of the bridge from the WinObjC project repo on GitHub
What are your thoughts on the Windows Bridge for iOS? Let us know in the comments.
- » PWNED: Researcher uses broken API to print message on GPS watches
- » Tax Justice Network: Google dodged £1.5bn tax in the UK last year
- » Opinion: Why Kubernetes Managed Services are becoming a key trend
- » Adopted or abandoned: Microsoft details Chromium-based Edge features
- » Google adds Smart Reply and Language Identification APIs to ML Kit