Contextual member has no associated value in Swift 3

后端 未结 1 1262
南方客
南方客 2021-01-23 21:15

While translating code

$0.backgroundColor = .redColor()

Into Swift 3 I\'m receiving this error:

/Users//Documents/proje

相关标签:
1条回答
  • 2021-01-23 21:51

    In Swift 3 .redColor() is changed to just .red.

     $0.backgroundColor = .red
    

    For more detail about this read Apple Documentation on UIColor under Symbols section check Type Properties.

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