如何在 Playground 中使用 Swift 包管理器 [英] How to use Swift Package Manager in Playground

查看:78
本文介绍了如何在 Playground 中使用 Swift 包管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Xcode Playground 中使用 Swift Package Manager?

Is it possible to use Swift Package Manager inside Xcode Playground ?

推荐答案

目前无法在 Playground 中使用 Swift Package Manager.原因是 Swift Package Manager 主要在苹果平台之外使用.

It is not possible to use the Swift Package Manager in a playground at this time. The reason for that is that the Swift Package Manager is primarily used outside of apple platforms.

Apple 在 Swift 包管理器的 GitHub 上提到了这一点:

Apple mentions this on the Swift Package Manager's GitHub:

请注意,此时包管理器不支持 iOS、watchOS 或 tvOS 平台

Note that at this time the Package Manager has no support for iOS, watchOS, or tvOS platforms

Swift 包管理器对于为 Linux 和 Mac 等平台编写 Swift 尤其有用.用途可能包括创建基于 Swift 编写的服务器或编写无需用户界面即可运行的程序(想想家庭自动化和物联网).这是一种无需使用 Pod 或其他第三方设置即可组织包的好方法.当您为生产(或调试)构建代码时,它会下载包并将其合并到项目中.

The Swift Package Manager is especially useful for writing Swift for platforms such as Linux and Mac. Uses may include creating servers based written in Swift or writing programs that can be run without a user interface (think home automations and IoT). It is a great way to organize packages without using Pods or other third-party setups. When you build the code for production (or debugging) it will download and incorporate packages into the project.

注意:这在未来可能会改变,但从 Swift 3 开始是最新的

Note: This may change in the future, but is current as of Swift 3

这篇关于如何在 Playground 中使用 Swift 包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆