'coerced to Any' but property is of type UIColor

前端 未结 4 836
深忆病人
深忆病人 2021-01-24 10:42

This

NSAttributedString.Key.foregroundColor: view.tintColor

Triggers this warning

Exp         


        
4条回答
  •  长情又很酷
    2021-01-24 10:56

    Just do this:

    guard let viewTint = view.tintColor else { return }
    NSAttributedString.Key.foregroundColor: viewTint
    

    Hope this helps!

提交回复
热议问题