在将我的可可框架项目转换为Swift 4之后,类UIFontDescriptorFamilyAttribute现在是UIFontDescriptor.AttributeName.family,,所以我将代码从:
// Swift 3
UIFontDescriptor(fontAttributes: [UIFontDescriptorFamilyAttribute: fontFamiliy])至
// Swift 4
UIFontDescriptor(fontAttributes: [UIFontDescriptor.AttributeName.family: fontFamiliy])然而,当我尝试-pod规格的皮棉-我得到下一个错误:
- ERROR | [iOS] xcodebuild: SerializableLabel.swift:108:68: error: type 'UIFontDescriptor' has no member 'AttributeName'cocoapods还没有意识到Swift 4吗?是否必须更新配置中的其他内容?
我的配置:
.podspec
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }cocoapods
$ pod --version
1.3.1发布于 2017-09-27 17:02:19
试着创建一个名为.的文件,内部只需放置4.0
Cocoapods的更新>= 1.5
现在在podspec中使用s.swift_version = '4.1'
发布于 2017-09-27 17:21:17
用于不同版本的Swift:
使用CocoaPods 1.3.1或更高版本
# example for Swift 4.0
echo "4.0" > .swift-version
pod lib lint使用CocoaPods 1.4.0或更高版本
# example for Swift 4.0
pod lib lint --swift-version=4.0https://stackoverflow.com/questions/46391132
复制相似问题