iOS project builds a universal Windows app

Source: Internet
Author: User

The first anniversary of GitHub's WINOBJC project recently released a preview version, and finally waited until this day. The WINOBJC project is Microsoft's announced Project Islandwood program at the build 2015 conference, dedicated to quickly porting iOS apps to uwp apps. Needless to say, let's take a look at how the WINOBJC project is actually used.

Before you begin

Start the transformation of iOS items now we need to deploy the WINOBJC tool, the tool chain is as follows:

    1. A Windows PC,2015 Community Edition with Visual Studio installed can be downloaded directly: Free download
    2. Install the WINOBJC Bridge tool for the iOS app and download it directly: Github
    3. Prepare some iOS projects that you can use, and there are many open source projects on GitHub

Note: Make sure you have installed the Windows SDK, or you will not be able to build using UWP projects.

In addition, you can directly use the evaluation version of Windows 10 development environment VM that Microsoft has configured. The virtual machine has been configured with the latest development environment to meet the needs, so you quickly use the latest tools on your Mac or PC to evaluate. The following are for different virtual machines:

    • VMware Https://aka.ms/windev_vm_vmware
    • Hyper-V https://aka.ms/windev_VM_hyperv
    • VirtualBox Https://aka.ms/windev_VM_virtualbox
    • Parallels Https://aka.ms/windev_VM_parallels

How to use

After extracting the downloaded Winobjc.zip file into a local file, we have an iOS bridge tool that we can use directly. Here I am using the example project of the famous iOS HUD framework Mbprogresshud to do the test, as follows: Https://github.com/jdg/MBProgressHUD

We mainly use the Vsimporter tool, using the following steps:

    1. Open the command line and navigate to the directory where the iOS project resides. CD C:\Users\changwei\Desktop\iOS\MBProgressHUD-master\Demo
    2. Run the Vsimporter tool from the command line. C:\Users\changwei\Desktop\winobjc\bin\vsimporter.exe
    3. Vsiimporter automatically removes test projects and tvOS projects that are not currently supported, generating a UWP project with the following results:

4. You can see that the SLN solution file has been generated and opens directly

5.Winobjc Folder Bin directory has a objective-c language highlighting plugin objc-syntax-highlighting.vsix, we do not forget to install OH. The current solution sln file, when opened, is a standard UWP project that runs directly ctrl+f5 the project.

The first build will take a long time, but the most painful is the compilation failed, Goodbye (sure enough or big pits).

      

Then I tried a lot of iOS projects, including some sample projects that were downloaded from the Apple Developer Center. most of them compile errors, and many of the UI interfaces and features that are run by a few can be incorrect, and are currently not functioning properly except for the official WINOJC sample project.

Let's take a look at what the official running example project actually looks like, as follows:

    

List View UITableView

Collection View Uicollectionview

Picture View Uiimageview

I tried to write a objective-c code into the project, adding an orange-yellow view to the current window, as follows:

UIView *testview = [[UIView alloc] Initwithframe:cgrectmake (0,0,200,200)];testview.backgroundcolor = [Uicolor Orangecolor]; [Self.view Addsubview:testview];

After the compilation runs, does not have the problem to execute, the function is also normal operation, as follows:

Summarize

The WINOBJC project looks beautiful, but it is still an unbearable pie. For a year, it is more than the beginning of progress, rewrite support for most of the iOS base library, Uikit and other basic framework completion is very high, AutoLayout, storyboard and xib are supported, but there is a long way to go. At present, we can still taste fresh, in fact, in my opinion, instead of rewriting the iOS framework, it is better to develop a set of Windows development Framework support OBJECTIVE-C, think better than now, not to be led by iOS, the problem continues.

iOS project builds a universal Windows app

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.