Search code examples
swiftxcode7.3

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


I'm using the following code:

var continousDigitsRange:Range<Int> = Range<Int>(start: 0, end: 0)

Since update to Xcode 7.3 (Swift 2.2) I got the following hint:

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

For me is not clear how to "translate" it correctly with "using the '..<' operator.


Solution

  • You should simply write

    var continousDigitsRange1:Range<Int> = 0..<0
    

    or if you want to go even simpler

    var continousDigitsRange = 0..<0