Xcode 8 / Swift 3: “Expression o

2017-03-08  本文已影响0人  c064b10abe55

代码中的警告

最终还是找到了解决办法:

_ = navigationController?.popViewController(animated: true)

解释:

popViewController(animated:)

returns UIViewController?,

这样的话,编译器警告,因为你不是捕捉价值。解决方案是将其分配给一个下划线(或者理解为强调没有返回值)

了解更多:

lists.swift.org/pipermail/swift-evolution-announce/2016-March/000075.html

上一篇 下一篇

猜你喜欢

热点阅读