【问题标题】:Swift - cocoapod circular sliderSwift - cocoapod 圆形滑块
【发布时间】:2017-01-17 07:51:28
【问题描述】:

我正在尝试在我的应用中使用 CircularSlider。

我找到了以下两个模块 https://github.com/taglia3/CircularSlider https://cocoapods.org/pods/HGCircularSlider

这就是我所做的

$pod init

这是我的 pod 文件

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Dr.FOOD' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Dr.FOOD
  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'HGCircularSlider', '~> 1.0.3'
  pod 'CircularSlider'

end

然后,我做了什么

$ pod install
Analyzing dependencies
Downloading dependencies
Using CircularSlider (1.1.2)
Using Firebase (3.11.0)
Using FirebaseAnalytics (3.6.0)
Using FirebaseCore (3.4.6)
Using FirebaseDatabase (3.1.1)
Using FirebaseInstanceID (1.0.8)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.1)
Using HGCircularSlider (1.0.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `Dr.FOOD.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 10 total pods installed.

我正在使用 .xcworkspace 但它仍然显示 “我的代码中没有这样的模块 'HGCircularSlider'”。

我做错了什么吗?

【问题讨论】:

  • 清理并构建代码
  • @GaneshKumar 清理并构建代码?
  • 请停止或关闭 xcode 然后安装 pod

标签: swift swift3 cocoapods hgcircularslider


【解决方案1】:

这是我在添加新 pod 时所做的,以及您已经做的。

  • 打开工作区文件,进入项目设置页面:

  • 向下滚动,您会看到:

  • 点击+按钮并添加你想要的所有框架。

  • Command + B 构建项目。

  • 现在导入模块

【讨论】:

  • @jlassap 如果您认为我的回答回答了您的问题,请考虑通过单击该复选标记接受它!
  • 它说我可以在 40 秒内检查。我稍后再做!谢谢
  • 这不是一个正确的答案,在使用 Cocoopods 时不应该这样做,@jlassap 遇到的问题与清理和重建项目有关。避免手动添加框架和配置项目是我们首先使用 Cocoapods 的原因。