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

mahega picture mahega · Mar 22, 2016 · Viewed 12.7k times · Source

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.

Answer

Scott Thompson picture Scott Thompson · Mar 22, 2016

You should simply write

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

or if you want to go even simpler

var continousDigitsRange = 0..<0