在不使用cocoapods的情况下将框架添加到现有项目中

时间:2023-01-27 11:02:24

I've got an existing project where i want to add the framework called CoreActionSheetPicker from

我有一个现有项目,我想从中添加名为CoreActionSheetPicker的框架

https://github.com/skywinder/ActionSheetPicker-3.0

The problem is i cant seem to add the framework to my project? when i pull the framework over to my existing project none of the files below is added and when i try to import it says it does not exist

问题是我似乎无法将框架添加到我的项目中?当我将框架拉到我现有的项目时,没有添加下面的文件,当我尝试导入它时说它不存在

import CoreActionSheetPicker

I want to do this without cocoaPods. What is the steps in order to do such? i'm using swift. Do i first need to create a WorkSpace?

我想在没有cocoaPods的情况下这样做。这样做的步骤是什么?我正在使用swift。我首先需要创建一个WorkSpace吗?

1 个解决方案

#1


6  

I've just cloned it, and it appears the project file is invalid. You can see this by trying to open it. You should raise the issue with the owner on GitHub, which is how you're supposed to ask questions about projects there. Then you will get feedback directly from the creator or at least someone else who knows about that project.

我刚刚克隆了它,看起来项目文件无效。您可以通过尝试打开它来看到这一点。您应该在GitHub上向所有者提出问题,这就是您应该如何询问有关项目的问题。然后,您将直接从创建者或至少知道该项目的其他人那里获得反馈。

As for adding a project,

至于添加项目,

  1. Download the source
  2. 下载源代码

  3. Drag the .xcodeproj into your project within Xcode
  4. 将.xcodeproj拖到Xcode中的项目中

  5. Add the framework in Build Phases / link binary with libraries
  6. 使用库在Build Phases / link二进制文件中添加框架

  7. Add it as a Build Phase / target dependency.
  8. 将其添加为构建阶段/目标依赖项。

Note that at the moment, you should always builds 3rd part libraries with your swift project, and not just include the binary. See here about binary compatibility of frameworks:

请注意,目前,您应该始终使用swift项目构建第三部分库,而不仅仅包括二进制文件。请参阅此处有关框架的二进制兼容性:

https://developer.apple.com/swift/blog/?id=2

#1


6  

I've just cloned it, and it appears the project file is invalid. You can see this by trying to open it. You should raise the issue with the owner on GitHub, which is how you're supposed to ask questions about projects there. Then you will get feedback directly from the creator or at least someone else who knows about that project.

我刚刚克隆了它,看起来项目文件无效。您可以通过尝试打开它来看到这一点。您应该在GitHub上向所有者提出问题,这就是您应该如何询问有关项目的问题。然后,您将直接从创建者或至少知道该项目的其他人那里获得反馈。

As for adding a project,

至于添加项目,

  1. Download the source
  2. 下载源代码

  3. Drag the .xcodeproj into your project within Xcode
  4. 将.xcodeproj拖到Xcode中的项目中

  5. Add the framework in Build Phases / link binary with libraries
  6. 使用库在Build Phases / link二进制文件中添加框架

  7. Add it as a Build Phase / target dependency.
  8. 将其添加为构建阶段/目标依赖项。

Note that at the moment, you should always builds 3rd part libraries with your swift project, and not just include the binary. See here about binary compatibility of frameworks:

请注意,目前,您应该始终使用swift项目构建第三部分库,而不仅仅包括二进制文件。请参阅此处有关框架的二进制兼容性:

https://developer.apple.com/swift/blog/?id=2