xcode 如何在没有可可豆荚的情况下安装项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28131329/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install projects without cocoa pods?
提问by PopKernel
I have seen various libraries on GitHub that look useful, but only list CocoaPods as an install method. I'm not sure I want to be dependent on CocoaPods, because I'm wary of Apple breaking it in some future OS X/Xcode update. Is there a way to get these libraries into my Xcode project withoutusing CocoaPods?
我在 GitHub 上看到了各种看起来很有用的库,但只将 CocoaPods 列为一种安装方法。我不确定我是否想依赖 CocoaPods,因为我担心 Apple 在未来的 OS X/Xcode 更新中破坏它。有没有办法在不使用 CocoaPods 的情况下将这些库放入我的 Xcode 项目中?
回答by Sinisa Drpa
Role of CocoaPods is to automate and simplify the process, but you don't need to use CocoaPods if you don't want to. In case of "manual installation", usually it would be:
CocoaPods 的作用是自动化和简化过程,但如果你不想,你不需要使用 CocoaPods。在“手动安装”的情况下,通常是:
- download the project from GitHub
- add the files to Xcode
- import headers
- 从 GitHub 下载项目
- 将文件添加到 Xcode
- 导入标题
But there is no universal recipe for every project, it may slightly differ from case to case, but usually it boils down to previously mentioned. The best way if you don't want to use CocoaPods is to read the project documentation, and study examples if there are any.
但是每个项目都没有通用的配方,可能因情况而异,但通常归结为前面提到的。如果你不想使用 CocoaPods,最好的方法是阅读项目文档,如果有的话,研究一下示例。
回答by skyline75489
Of course there is. Basically you need to download the library project, drag the project into your own project, do some library dependency setup and you're done.
当然有。基本上你需要下载库项目,将项目拖到你自己的项目中,做一些库依赖设置,你就完成了。
For details, check out https://github.com/Alamofire/Alamofirefor manually adding a Swift library. And https://github.com/jverkoey/ObjQREncoderfor manually adding a Objective-C library to your project.
有关详细信息,请查看https://github.com/Alamofire/Alamofire以手动添加 Swift 库。和https://github.com/jverkoey/ObjQREncoder用于手动将 Objective-C 库添加到您的项目。
回答by scott
The only way to install things without Cocoapods is to just drag the source code of other projects into your class. For example, most Github projects can be installed via Cocoapods, or you can just drag the relevant source code into your projects. You don't need to drag in all of the project resources, all you need is usually class files
在没有 Cocoapods 的情况下安装东西的唯一方法是将其他项目的源代码拖到您的类中。例如,大多数 Github 项目都可以通过 Cocoapods 安装,或者您可以直接将相关源代码拖到您的项目中。你不需要把所有的项目资源都拖进去,你需要的通常是类文件