'init(start:end:)' 已弃用:它将在 Swift 3 中删除.使用 '..<'操作员 [英] 'init(start:end:)' is deprecated: it will be removed in Swift 3. Use the '..<' operator

查看:35
本文介绍了'init(start:end:)' 已弃用:它将在 Swift 3 中删除.使用 '..<'操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码:

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

自从更新到 Xcode 7.3 (Swift 2.2) 后,我得到以下提示:

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

'init(start:end:)' 已弃用:它将在 Swift 3 中删除.使用'..<'操作员.

'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.

推荐答案

你应该简单地写

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

或者如果你想更简单

var continousDigitsRange = 0..<0

这篇关于'init(start:end:)' 已弃用:它将在 Swift 3 中删除.使用 '..&lt;'操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆