📜 ⬆️ ⬇️

Compiling iOS apps for Windows Store



In April of this year, a very interesting announcement was made at the // Build conference, which showed the possibility of compiling and assembling ObjectiveC code for the Windows Store. I am happy to announce that now this technology and tools have become public, you can now download the components of the ObjC / iOS application build for Visual Studio 2015 and build the application for the Windows Store.

Where to start


At https://github.com/Microsoft/WinObjC/releases published SDK that contains components for building an iOS application for the Windows Store. In order to try them in, you need Windows 10 and Visual Studio Community 2015 . Unzip the contents of winobjc.zip and open the file samples \ HelloUI \ HelloUI-WinStore10.sln. Next, we make the Hello-UI-Winstore project active (in the Solution Explorer, open the context menu, “Set as StartUP Project”) and press F5.


')

Welcome to the world of cross-compiling ObjectiveC for Windows.



The package prepared by the Microsoft team contains the ObjectiveC compiler, integration components with Visual Studio 2015, the main parts of the iOS SDK, and additional application conversion tools.
The basic features of the SDK can be found in the samples \ WOCCatalog \ WOCCatalog-WinStore10.sln example.



This example shows the main uses for the interface components:



Interaction with OpenGL:



By the way, this SDK can also build applications for Windows 8.1 and Windows Phone 8.1.



It is somewhat unusual to see the standard iOS interface elements on Windows Phone.

IOS Project Conversion


In order to turn an iOS project into a Visual Studio project, you can use the special utility \ bin \ vsimporter.exe .
For example, let's make git clone https://github.com/ericjohnson/canabalt-ios.git and run vsimporter in the source directory of this project. As a result, you will have the Canabalt-WinStore10.sln file, open it in Visual Studio 2015 and build the project:



For some reason, it works rotated 90 degrees.

Or for example:

git clone https://github.com/haqu/tweejump.git cd tweejump winobjc_sdk_path\bin\vsimporter.exe 

Result of compilation for Windows 10:



What is in active development?


The WinobjC project is in active development and some features do not work:
  1. No support for ARM, only x86.
  2. Compiler optimizations do not work. Most likely they will lead to the crash of clang, while you can only use debug builds.
  3. Autolayout
  4. Storyboard support
  5. MapKit
  6. AssetsLibrary
  7. AddressBook
  8. Ads
  9. Objective-C annotations
  10. Media capture

If you have questions and would like to learn more about this project, go to the http://stackoverflow.com/ forums, label your questions with the WinObjC tag and read the wiki https://github.com/Microsoft/WinObjC/wiki .

Source: https://habr.com/ru/post/264321/


All Articles