我在自定义键盘扩展中使用Alamofire和SwiftyJSON。我在视图中创建了一个键盘并将其放在视图控制器中。我想使用那些相同的文件来表示键盘,所以我创建了一个新的目标“键盘”,并为键盘扩展和BibleKeyboardView.swift
文件的项目添加了目标成员资格。但是,一旦我添加目标成员资格,我得到错误No such module Alamofire
和Command CompileSwiftSources failed with a nonzero exit code
。即使我切换Keyboard
的目标会员资格,它仍然有Command CompileSwiftSources failed with a nonzero exit code
。我也打开.xcworkspace文件。
我试过了:
pod install
任何人都知道发生了什么?
文件结构,目标成员资格和错误的图片如下:
我提交这个问题后,我有一丝灵感。
我的Podfile
最初有
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'BibleKeyboard-iPad' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BibleKeyboard-iPad
pod 'Alamofire'
pod 'SwiftyJSON'
end
但我需要补充一下
target 'Keyboard' do
use_frameworks!
pod 'Alamofire'
pod 'SwiftyJSON'
end