Xcode - Podfile无法正确安装swiftvalidator

时间:2015-12-28 10:25:30

标签: ios xcode swift

我正在尝试安装SwiftValidator库(Accessible here,但我无法让它工作。

基本打开终端和cd到xcode项目的目录。在那里,我创建了一个包含以下内容的Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.1"

use_frameworks!
pod 'SwiftValidator', '3.0.1' 

之后我输入了终端:

  

pod install

这是我在控制台中得到的输出:

Updating local specs repositories

Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  From https://github.com/CocoaPods/Specs
     435c890..1ee4098  master     -> origin/master
  Updating 435c890..1ee4098
  Fast-forward
   Specs/KMCache/0.1.1/KMCache.podspec.json | 20 ++++++++++++++++++++
   1 file changed, 20 insertions(+)
   create mode 100644 Specs/KMCache/0.1.1/KMCache.podspec.json

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods`: (``)

Finding Podfile changes
  - SwiftValidator

Resolving dependencies of `Podfile`

Comparing resolved specification to the sandbox manifest
  - SwiftValidator

Downloading dependencies

-> Using SwiftValidator (3.0.1)
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `SwiftValidator` iOS 8.1
      - Generating Info.plist file at `Pods/Target Support
      Files/SwiftValidator/Info.plist`
      - Generating module map file at `Pods/Target Support
      Files/SwiftValidator/SwiftValidator.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/SwiftValidator/SwiftValidator-umbrella.h`
    - Installing target `Pods` iOS 8.1
      - Generating Info.plist file at `Pods/Target Support
      Files/Pods/Info.plist`
      - Generating module map file at `Pods/Target Support
      Files/Pods/Pods.modulemap`
      - Generating umbrella header at `Pods/Target Support
      Files/Pods/Pods-umbrella.h`
  - Running post install hooks
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
    - Generating deterministic UUIDs
  - Writing Lockfile in `Podfile.lock`
  - Writing Manifest in `Pods/Manifest.lock`

Integrating client project

Integrating target `Pods` (`Mawq.xcodeproj` project)
  - Running post install hooks
    - cocoapods-stats from
    `/Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-0.6.2/lib/cocoapods_plugin.rb`

Sending stats
      - SwiftValidator, 3.0.1
  Pod installation complete! There is 1 dependency from the Podfile and 1 total
  pod installed.
事情似乎很棒,但是当我打开项目(不是.xcodeproj文件而不是.xcworkspace)并且我输入以下视图控制器类时,它表示它无法识别底层模块

import SwiftValidator

当事情似乎正确安装时,知道为什么会发生这种情况吗?

更新:添加了项目目录的图像......

enter image description here

2 个答案:

答案 0 :(得分:1)

所以这是出乎意料的。我必须实际构建一次项目然后当我输入import语句时它显示了SwiftValidator库。

这是意料之外的,因为我之前安装了其他pod,这从来都不需要。希望这有助于下一个人。

答案 1 :(得分:0)

也许该框架不能称为SwiftValidator - 检查Pods项目的产品,看看它在框架方面产生了什么

只是一个示例,显示了在Xcode中的位置。

enter image description here