此问题在此处已有答案:
#warning: C-style for statement is deprecated and will be removed in a future version of Swift [duplicate](4个答案)
六年前就关门了。
我有一些代码在我的项目和下面的代码给予警告;
private var viewController: UIViewController? {
for var next:UIView? = self.superview; next != nil; next = next?.superview {
let responder = next?.nextResponder()
if let vc = responder as? UIViewController {
return vc
}
}
return nil
}
字符串
下面的警告行:
for var next:UIView? = self.superview; next != nil; next = next?.superview {
型
我该怎么解决?
1条答案
按热度按时间3z6pesqy1#
下面是如何用
while
循环重写代码的方法:字符串