将 cocoapods 添加到我的 PodFile

Adding cocoapods into my PodFile

我正在开发一个需要 cocoapods 的应用程序。在这个应用程序的手册中写着

Add this to your Podfile:

pod 'SwiftSocket'

And run then pod install

但是当我使用 pod init 将 pod 文件放入我的文件夹然后 open -a Xcode Podfile 并在其中添加行时

target 'SwiftSocket' do
pod 'SwiftSocket'
end

最后一个 pod install 它告诉我一个错误

Unable to find a target named SwiftSocket, did find SwiftSocket iOS, SwiftSocket macOS, SwiftSocket tvOS, and iOS Example.

Edit____________

我文件夹的图片。

以及我的 Podfile 现在的样子

它运行良好,请查看我的播客文件

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

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

pod 'SwiftSocket'

  # Pods for Demo

end

Demo 是项目名称。 目标名称 将是您的项目名称