NSFontAttributeName vs NSAttributedStringKey.font

前端 未结 2 2284
离开以前
离开以前 2021-02-20 16:29

I am having some trouble with Swift code in a library I have been using for a while. It seems related to some kind of version conflict, but I am not sure.

Here is the co

2条回答
  •  我在风中等你
    2021-02-20 16:54

    The projects are probably in different versions of Swift.

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

    In Swift 5, NSFontAttributeName has been replaced with NSAttributedString.Key.font.

提交回复
热议问题