'init(start:end:)' is deprecated: it will be removed in Swift 3. Use the '..<' operator

后端 未结 6 590
予麋鹿
予麋鹿 2020-12-04 20:54

I\'m using the following code:

var continousDigitsRange:Range = Range(start: 0, end: 0)

Since update to Xcode 7.3 (Sw

6条回答
  •  醉酒成梦
    2020-12-04 21:42

    The closed range operator (a...b) defines a range that runs from a to b, and includes the values a and b. The value of a must not be greater than b.

    The half-open range operator (a.. defines a range that runs from a to b, but does not include b. It is said to be half-open because it contains its first value, but not its final value. As with the closed range operator, the value of a must not be greater than b. If the value of a is equal to b, then the resulting range will be empty.

    The Swift Programming Language (Swift 2.2) - Basic Operators

    var continousDigitsRange:Range = Range(start: 0, end: 0)
    --to--
    var continousDigitsRange:Range = 0..<0
    

提交回复
热议问题