繁体   English   中英

是否可以在同一项目中同时安装Objective C和Swift库以及Cocoapods?

[英]Is it possible to install both objective c and swift library with Cocoapods in same project?

我想在我的目标C项目中同时使用Swift编写的图表(danielgindi / Charts)Objc编写的Material Components Material Components

我按照以下步骤添加了两个库

target 'chart4' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
   use_frameworks!

  # Pods for chart4

  pod 'Charts'

执行的命令pod install

我打开了pod文件,删除了use_frameworks! pod 'Charts'并评论了use_frameworks!

target 'chart4' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
   #use_frameworks!

  # Pods for chart4
 pod 'MaterialComponents'

执行命令pod update但导致自动删除Charts 我得到以下回应

Analyzing dependencies
Removing Charts
Downloading dependencies
Installing MDFTextAccessibility (1.2.0)
Installing MaterialComponents (34.0.1)
Installing MotionAnimator (1.1.0)
Installing MotionInterchange (1.0.1)
Installing MotionTransitioning (3.2.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 5 total pods installed.

是否可以使用cocoapod安装以Swift编写的两个图表(danielgindi /图表)和同一项目中的Material Components Material Components

我的第二个疑问: pod update是将新Pod添加到已经具有现有Pod的项目中的正确方法。

今天我添加了Pod'AFNetworking',明天我删除了'AFNetworking'(仅从Pod文件而不是项目中)添加了'SDWebImage'运行pod update。 3天后ii删除“ SDWebImage”(仅从Pod文件而不是项目中)添加“图表”。 pod update了达到目标的方式吗?

使用此并进行pod install ,您无需删除pod'Charts'

target 'chart4' do

  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks

   use_frameworks!

      # Pods for chart4

  pod 'Charts'

  pod 'MaterialComponents'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM