ios - 如何分享我构建并发现非常有用的自定义 swift 扩展

标签 ios swift github open-source swift-extensions

我想分享一些我为我的应用程序构建的非常有用的快速扩展。我敢肯定,有许多开发人员希望轻松地将自定义功能添加到他们的应用程序中。唯一的问题是我找不到共享这些扩展的好方法。

我是一名经验丰富的软件工程师(我的大部分经验与网络相关),最近开始使用 iOS 应用程序,我不熟悉快速扩展的打包和分发。

我目前正在使用 Carthage 作为依赖管理器,我知道 CocoaPods 更受欢迎,也许 Swift Package Manager 会在不久的将来出现 - 所以我希望能够发布扩展,以便人们使用任何这些包管理器可以轻松地将它们添加到他们的项目中。

谁能给我指出正确的方向?

最佳答案

I would recommend using a dependency manager like CocoaPods in order to make updating to newer versions of your extensions and installing them easier.

您可能还想在您的个人博客上分享指向 CocoaPods pod 的链接,并传播有关您的库/扩展的新闻。

In CocoaPods you should provide the .Swift file as the installable pod, but should also provide the Xcode project for pod try functionality, where people try out your extension before embedding it into their projects.

这是 CocoaPods 上的过渡扩展示例(这些是 GitHub 中显示的文件):

enter image description here

As you can see, a demo project is provided, but when installing the pod, only the relevant Swift files are added to the project.

您可以从这里开始:https://guides.cocoapods.org/making/making-a-cocoapod.html

希望一切都解决了。祝你好运 :)

关于ios - 如何分享我构建并发现非常有用的自定义 swift 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40398149/

相关文章:

Swift - 设备上不包含预填充的 SQLite 数据库

GitFlow : merge to master first or after prod release?

git - 为什么 git 认为我的 .sql 文件是二进制文件?

ios - 你需要一个横向的 iPad 启动图像吗?

ios - 在 TableView 中数据被覆盖

ios - 核心数据多线程性能

selenium - 在 Jenkins 中通过 run.bat 文件运行我的 git 测试时在类路径异常中找不到类

ios - 单击后退按钮返回 2 segue

swift - 无法在 Swift 中导入 MobileDevice 模块

ios - Swift:删除 iOS 操作扩展中的照片