我需要在我的Swift项目中使用SwiftyJSON和Alamofire,所以我使用cocoapods。
我的podfile是:
platform :ios, '9.0'
target 'SwiftSalt' do
use_frameworks!
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end此外,我还添加了一个USER_HEADER_SEARCH_PATHS,$(PODS_ROOT)/**。
但是,它仍然不起作用。它显示“没有这样的模块'SwiftyJSON'”。模块是什么意思?
发布于 2016-09-20 12:00:47
将config.build_settings更改为swift 2.3。因为swiftyJSON还在使用swift 2.3
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end结束
发布于 2016-09-28 05:34:41
使用以下podfile安装了SwiftyJSON的Swift 3分支,并在项目中运行:
platform :ios, ’10.0’
project ‘/Users/You/yourproject.xcodeproj’
target 'yourproject' do
use_frameworks!
pod 'SwiftyJSON', :git => 'https://github.com/appsailor/SwiftyJSON.git', :branch => 'swift3'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end发布于 2016-09-28 08:09:15
pod 'Alamofire', '~> 4.0'
pod 'SwiftyJSON', :git => 'https://github.com/appsailor/SwiftyJSON.git', :branch => 'swift3'https://stackoverflow.com/questions/39584390
复制相似问题