整合/安装cocoapods到现有的xcode项目,objective-c或swift [英] Integarte/Install cocoapods to existing xcode project, objective-c or swift

查看:197
本文介绍了整合/安装cocoapods到现有的xcode项目,objective-c或swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找将cocoapods集成到我现有的xcode项目中。



我找到了这些帖子,但它们是基于问题而不是我的问题。





安装lib / framework



现在我们已经添加了我们所需的lib / framework pod命令

  pod'SwiftForms'

让我们去安装



步骤5在终端输入以下命令并按Enter键



pod install



结果屏幕





而已!!我们已经完成了。



使用pod打开项目



现在转到项目文件夹,我们可以看到CocoaPods创建了一个新的project_name.xcworkspace文件和一个Pods文件夹。



用xcode打开project_name.xcworkspace



您的项目结构应如下所示




I was looking for integrating cocoapods to my existing xcode projects.

I found these few post but they are based on issue instead my problem.

not able to acess installed pods framework

How to add cocoapods to existing workspace not project (this one is for work-space not project)

Making a CocoaPod from an existing Xcode project (this one is more on integrating swift with objective c project)

So I spending quality time i did for my project. I am sharing step by step integration in my answer post.

please feel free to suggest and improvement.

happy to learn and share

解决方案

Install CocoaPods on System

Step.1 Open Terminal and enter the following command:

sudo gem install cocoapods


Create Podfile for Project

Step.2 now you need to close Xcode.

Open Terminal at project's root folder

Step.3 Next, enter below command to create podfile:

pod init


Edit podfile

Note: Make sure we will edit podfile with Xcode not TextEdit etc.

Step.4 Type this command to open the Podfile using Xcode for editing:

open -a Xcode Podfile

Step.5 update pode file as shown below screenshot, save and close.

Install lib/framework

Now we have added our required lib/framework pod command

pod 'SwiftForms'

let's go for install

Step.5 Enter the following command in Terminal and hit Enter

pod install

Result screen

Thats it!! we have done.

Open Project with pods

Now go to the project folder,we can see that CocoaPods created a new project_name.xcworkspace file and a Pods folder.

open project_name.xcworkspace with xcode

your project structure should look like

这篇关于整合/安装cocoapods到现有的xcode项目,objective-c或swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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