类型'NSAttributedStringKey'(又名'NSString')没有成员'font' [英] Type 'NSAttributedStringKey' (aka 'NSString') has no member 'font'

查看:1226
本文介绍了类型'NSAttributedStringKey'(又名'NSString')没有成员'font'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚更新了xcode 9的pod,我收到以下


输入'NSAttributedStringKey'(又名'NSString')没有成员'font'



解决方案

注意:确保swift语言版本你的项目。以下是如何查看/检查您的快速语言版本。







您有两个选项作为查询的解决方案:


  1. 如果您的项目有Swift版本4.0

    - 您应该选择/下载与您项目的快速语言兼容的POD(分享我的POD信息和swift版本,这样我就可以为您的pod库提供适合项目的精确pod版本。)


  2. 如果您的项目有快速版本低于4.0

    - 你需要将你的项目迁移到Swift 4.0(如果你没有迁移它)。这是ref问题和答案,如何从swift(下面)< 4.0迁移到4.0。






根据您在问题中添加的标签 - Swift3是您当前的项目语言版本,pod'Cosmos','〜> 12.0'支持swift 4。

  pod'Cosmos','〜> 12.0'

以下是支持Swift版本低于4.0的上一版本列表。



https://github.com/evgenyneu/Cosmos/releases



尝试以前的cosmos版本:

  pod'Cosmos ','〜> 11.0.3'
//或
pod'Cosmos','〜> 11.0.1'
//或
pod'Cosmos','〜> 11.0.0

'


Just updated pods for xcode 9 and I'm getting the error below for Cosmos.

Type 'NSAttributedStringKey' (aka 'NSString') has no member 'font'

解决方案

Note: Ensure swift language version of your project. Here is how you can see/check your swift language version.


You have two options as solution to your query:

  1. If your project has Swift versio 4.0
    - You should choose/download POD compatible to your project's swift language (Share me POD info and swift version, so I can provide you exact pod version version for your pod library suitable for project).

  2. If your project has swift version below 4.0
    - You need to migrate your project into Swift 4.0 (if you've not migrated it). Here is ref question and answer, how to migrate from swift (below) <4.0 to 4.0.


According to tag added by you in your question - Swift3 is your current project language version and pod 'Cosmos', '~> 12.0' is supporting swift 4.

pod 'Cosmos', '~> 12.0'

Here is list of previous release supporting Swift version below 4.0.

https://github.com/evgenyneu/Cosmos/releases

Try previous release of cosmos like:

pod 'Cosmos', '~> 11.0.3'
// or
pod 'Cosmos', '~> 11.0.1'
// or
pod 'Cosmos', '~> 11.0.0

'

这篇关于类型'NSAttributedStringKey'(又名'NSString')没有成员'font'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆