var count: UInt = 0 var view: UIView = self while view.superview != nil { // Cannot invoke '!=' with an argument list of type '(@lvalue UIView,NilLiteralConvertible)' count++ view = view.superview } // Here comes count...
我正在使用Xcode6-Beta7.
var count: UInt = 0 var view: UIView = self while view.superview != nil { // Cannot invoke '!=' with an argument list of type '(@lvalue UIView,NilLiteralConvertible)' count++ view = view.superview } // Here comes count...
我正在使用Xcode6-Beta7.
var count: UInt = 0 var view: UIView? = self.superview while view != nil { // Cannot invoke '!=' with an argument list of type '(@lvalue UIView,NilLiteralConvertible)' count++ view = view!.superview }
或者做一个约束力,但在这里似乎没有必要,我想.