swift 中的 CDPieMenu (cocoapod)

CDPieMenu (cocoapod) in swift

我正在尝试添加 CDPieMenu to my swift project using a .podspec gist I found here

我在本地下载了 podspec 并将其添加到我的 podfile 中,如下所示:

  pod 'CDPieMenu', :path => '~/Documents/Project/CDPieMenu.podspec'

这是 podspec:

Pod::Spec.new do |s|
    s.name     = 'CDPieMenu'
    s.version  = '0.1'
    s.license  = 'MIT License'
    s.summary  = 'Fully and easily customizable rotary wheel control also called pie menu for iPhone and iPad.'
    s.homepage = 'https://github.com/wczekalski/CDPieMenu'
    s.author   = { 'W. Czekalski'    => 'me@wczekalski.com' }

    s.source   = { :git => 'https://github.com/wczekalski/CDPieMenu.git', :commit => '2f49362' }
    s.source_files = 'Wheel'

    s.description = 'Fully and easily customizable rotary wheel control also called pie menu for iPhone and iPad.'
    'Very similar to the control in Convertbot. As the only one in the internet it rotates with inertia/mementum.'
    'Drawn using CoreGraphics without any images.'

    s.platform = :ios
    s.frameworks = 'AudioToolbox', 'QuartzCore'
    s.requires_arc = true
end

我 运行 pod update 一切正常,似乎已经安装好了。

但是,我现在无法从我的项目文件中引用它。 我错过了什么吗?

编辑 1:

我忘了说我已经设置了 bridging-header 并添加了 CDPieMenu headers。

项目-bridging-header:

#import "CDCircle.h"
#import "CDCircleGestureRecognizer.h"
#import "CDCircleOverlayView.h"
#import "CDCircleThumb.h"
#import "CDIconView.h"
#import "Common.h"

编辑 2:

我刚刚检查了一下,好像 pod 根本没有安装。 Pods 目录中没有 CDPieMenu。 但是 pod update 没有抛出任何错误。

尝试 "pod install" 而不是 "pod update"。

编辑:

并且不要忘记使用 .xcworkspace 文件打开您的项目。

我在这里遇到了两个问题,其中一个我能够使用@whatever38 的建议解决,即我使用的是 pod update 而不是 pod install

另一个问题是我需要在 Podfile 中指定我的 podspec 文件的路径。我是通过指定 :path => 参数来执行此操作的,而我应该改为使用 :podspec => 参数。 因此,我的 Podfile CDPieMenu 条目应该如下所示:

pod 'CDPieMenu', :podspec => '~/Documents/Project/CDPieMenu.podspec'