Swift 3 - How to write functions with no initialisers like the new UIColors?

前端 未结 6 614
再見小時候
再見小時候 2021-01-18 17:31

In previous versions of swift, you would get the colour white like this UIColor.whiteColor()

However, in Swift 3, you get the colour white without initi

6条回答
  •  滥情空心
    2021-01-18 17:49

    In Swift 3.0:

    in UIColor.white, white is a property and not a method/initializer

    In earlier swift versions:

    in UIColor.whiteColor(), white was a type method.

提交回复
热议问题