NSAttributedStringKey giving an unresolved identifier error

后端 未结 6 1783
暖寄归人
暖寄归人 2020-12-30 04:15

I\'m following an online tutorial to build a magazine type iOS application. I\'m attempting to use NSAttributedStringKey but keep getting the error shown below. Any ideas?

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 04:44

    The projects are probably in different versions of Swift.

    In Swift 4, NSFontAttributeName has been replaced with NSAttributedStringKey.font.

    as stated here NSFontAttributeName vs NSAttributedStringKey.font

    Need to confirm whether it will work on versions less than ios11

提交回复
热议问题