NSAttributedStringKey giving an unresolved identifier error

后端 未结 6 1802
暖寄归人
暖寄归人 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条回答
  •  情书的邮戳
    2020-12-30 04:44

    You are trying to use an iOS 11 API on a pre-iOS 11 version (likely iOS 10). Surprised that you found a tutorial already using beta features!

    In the meantime, try this.

    let attrs = [NSForegroundColorAttributeName: color, NSFontAttributeName: font]

    and that should work.

提交回复
热议问题