将我的可可框架项目转换为 Swift 4 后,类UIFontDescriptorFamilyAttribute现在是UIFontDescriptor.AttributeName.family,所以我将代码更改为:
// Swift 3
UIFontDescriptor(fontAttributes: [UIFontDescriptorFamilyAttribute: fontFamiliy])
至
// Swift 4
UIFontDescriptor(fontAttributes: [UIFontDescriptor.AttributeName.family: fontFamiliy])
但是,当我尝试 - pod spec lint - 我得到下一个错误:
- 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' }
可可足类
$ pod --version
1.3.1