适用于Windows的Objective-C,包括UIKit(公共存档)。来自微软。
WinObjC – The Windows Bridge for iOS

原始链接: https://github.com/microsoft/WinObjC

## iOS 桥接 Windows:摘要 Windows Bridge for iOS (WinObjC) 是微软的一个开源项目,它使开发者能够在通用 Windows 平台 (UWP) 应用中重用现有的 Objective-C 代码和 iOS API。 这使得 iOS 应用能够在各种 Windows 10 设备上运行,并利用 Windows 的功能,如 Cortana 和通知。 **入门需要:** Windows 10 (版本 10586+), Visual Studio 2017 带有特定的开发者工具(包括通用 Windows 平台 & 使用 .NET 的移动开发),以及通过 Chocolatey 安装的命令行工具 (`choco upgrade winobjc-tools`)。 **导入 Xcode 项目** 涉及使用 PowerShell 中的 `vsimporter.exe` 工具生成 Visual Studio 解决方案。 示例,如 WOCCatalog,可用于演示功能并提供代码示例。 全面的文档、教程、开发路线图和常见问题解答可在项目的 Wiki 和 Windows Dev Center 网站上找到。 开发者可以按照 Wiki 中概述的指南并遵守 Microsoft 开源行为准则为项目做出贡献。 对于希望从源代码构建的贡献者,提供了高级安装步骤。

一场 Hacker News 的讨论围绕着微软的“WinObjC”项目——一个使用 Objective-C 进行 iOS 开发的 Windows 桥接项目,该项目自 2025 年 5 月起已归档并变为只读。一些评论者怀念 Objective-C 的可读性,但该项目总体上被视为一个错失的机会,因为时机不佳。 微软在 Swift 首次发布但尚未开源之前宣布了该项目,阻碍了潜在的互操作性。此外,它是在 Windows 8 移动版失败之后推出的。 几位用户指出,苹果之前曾将其部分技术(如 QuickTime 的 Toolbox 以及 iTunes/Safari 的运行时)移植到 Windows,这可能为这种桥接奠定了基础。 普遍的共识是,这项工作应该更早开始,理想情况下是在 iPhone 兴起之前,才能产生真正的影响。 该项目的当前状态引发了对潜在安全漏洞的担忧。 最后,包含了一个 Y Combinator 的申请通知。
相关文章

原文

The Windows Bridge for iOS (also referred to as WinObjC) is a Microsoft open-source project that provides an Objective-C development environment for Visual Studio and support for iOS APIs. The bridge allows you to create Universal Windows Platform (UWP) apps that will run on many Windows devices by re-using your Objective-C code and iOS APIs alongside Windows 10 features like Cortana and Windows Notifications.

license

Download and Installation

To use the bridge you'll need:

  • Windows 10, build 10586 or higher. Validate your version number here.

  • Visual Studio 2017 with Windows developer tools. Visual Studio 2017 Community is available for free here.

    Ensure the following individual components are selected during installation. Selecting the Universal Windows Platform development workflow should give most of the below

    NOTE: Please also install the Mobile development with .NET workflow option (Xamarin Tools) due to a bug in Nugetizer (See Issue 5026)

    (Click to Expand)
    • Visual Studio Core Editor
    • Nuget Package Manager
    • C# and Visual Basic Roslyn compilers
    • Static analysis tools
    • Windows 10 SDK (10.0.14393.0)
    • Visual Studio C++ core features
    • VC++ 2017 v141 toolset (x86, x64)
    • Visual C++ compilers and libraries for ARM
    • Visual C++ runtime for UWP
    • Windows 10 SDK (10.0.10240.0)
    • Windows 10 SDK (10.0.10586.0)
    • MSBuild
    • Windows Universal CRT SDK
    • Standard Library Modules
    • VC++ 2015.3 v140 toolset (x86,x64)
    • Windows Universal C Runtime

To get started with an existing Xcode Project, you will also need:

  • Chocolatey, a package manager for windows. See how to install the latest version here
  • winobjc-tools, the command line tools for WinObjC. Run the below command from powershell (Admin) to get the latest version:
choco upgrade winobjc-tools

(more information about this command and its options can be found here. If you want to use develop packages add --pre to the command.)

Getting Started With the Bridge

Importing your Xcode Project

When using the bridge, the first thing you'll want to do is generate a Visual Studio solution from your Xcode project:

  1. Open Windows PowerShell (type powershell in the Start Menu to find it) and navigate to your Xcode project directory using the cd command. Note: use the directory containing your .workspace or .xcodeproj folder.
  1. Run the vsimporter tool. This will generate the Visual Studio Solution:
  C:\MyProject> vsimporter.exe
  1. Open the generated Visual Studio solution with the command:
  C:\MyProject> MyProject.sln

For more detailed step by step instructions on how to import a project, see the Quick Start Tutorial page of the wiki. For vsimporter options and known issues, check the Using vsimporter wiki page.

Building & Running the Samples

A great way to learn more about the bridge and its features is building and running the samples of the SDK, which contain many code examples. We recommend starting with the WOCCatalog sample app, which demonstrates an assortment of iOS and XAML UI controls:

  1. Clone the repo.
  2. Navigate to the samples/WOCCatalog directory of the bridge SDK
  3. Double-click on the WOCCatalog-WinStore10.sln solution to open it in Visual Studio
  4. In Visual Studio, right-click on the WOCCatalog (Universal Windows) project
  5. Select Set as StartUp project
  6. Use Ctrl-F5 to build and run the app

For more detailed step by step instructions, see the Quick Start Tutorial page of the wiki.

Resources & Documentation

The following resources will help you get started. For more information, check out:

  1. Wiki, for documentation and tutorials
  2. Development Roadmap, detailing our highest priorities
  3. Website on Windows Dev Center, for evaluation virtual machines
  4. Quick Start Challenge, for a quick hands-on introduction to the bridge
  5. FAQ, with common questions and issues
  6. The iOS Bridge Samples Repo, for sample apps and code using the bridge

There are many ways to contribute to the Windows Bridge for iOS:

See our contribution guidance in the wiki for more details on how to contribute to the project.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Advanced Installation for Contributors and Ninjas

Additional Visual Studio Components Needed for Contributors:

  1. C# and Visual Basic
  2. Visual Studio SDK
  3. .NET Framework 4.6 targeting pack
  4. C++ Profiling Tools

If you want to build the bridge from source instead, you'll also need to install Git LFS before cloning the repo. For more detailed instructions, see the Building From Source wiki page.

If you're having trouble downloading & installing the bridge, see the Known Issues section below and check our FAQ.

See Microsoft's privacy statement for more information.

For details on our planned features and future direction sort the list of issues by milestone and refer to our roadmap.

联系我们 contact @ memedata.com