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

前端 未结 7 2060
别跟我提以往
别跟我提以往 2020-12-10 00:39

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

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

相关标签:
7条回答
  • 2020-12-10 01:32

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

    enter image description here


    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.

      • Xcode 9 Swift Language Version (SWIFT_VERSION)


    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
    

    '

    0 讨论(0)
提交回复
热议问题