ios - Xcode - Podfile 没有正确安装 swiftvalidator

标签 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)并在 View Controller 类中键入以下内容时,它说它无法识别底层模块

import SwiftValidator

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

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

enter image description here

最佳答案

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

这是出乎意料的,因为我之前安装了其他 pod,而这从来都不是必需的。希望这对下一个人有帮助。

关于ios - Xcode - Podfile 没有正确安装 swiftvalidator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34491735/

相关文章:

ios - 如何更改 iCarousel 库的包装属性?

ios - swift - 弹出窗口在横向模式下显示不正确

ios - 在 iOS 应用程序中格式化 UITableViewCell

swift - 泛型类型错误 : Cannot explicitly specialise a generic type

ios - Xcode 多个 UIButton Action

ios - 允许 (“null” ) 访问您的 SoundCloud 帐户

ios - 'NSError' 不可转换为 'UInt8'

iOS 7 SpriteKit - 创建游戏菜单/按钮(场景与更多 View Controller )

ios - 多个 Xcode 项目将不再在真实的 iOS 设备上成功编译

xcode - 如何在 Xcode 7 的自动布局中更轻松地 "update all frames"?