应用程序开发的助手和扩展
选择 File
-> Swift Packages
-> Add Package Dependency
并输入 https://github.com/Saik0s/AppDevUtils
。
您可以将 AppDevUtils
作为包依赖项添加到您的 Package.swift
文件中
let package = Package(
//...
dependencies: [
.package(
url: "https://github.com/Saik0s/AppDevUtils",
exact: "0.0.1"
),
],
//...
)
之后,在您需要它的任何包目标中,将 AppDevUtils
称为“目标依赖项”。
targets: [
.target(
name: "YourLibrary",
dependencies: [
"AppDevUtils",
],
...
),
...
]
然后,在任何您想使用它的地方,只需 import AppDevUtils
即可。
📝 注意: 为了使库在您的整个项目中可用,您还可以通过将以下行放在项目顶层某处,来利用 @_exported
关键字的功能
@_exported import AppDevUtils
AppDevUtils
在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。