崩溃发生在iPhone 5s(真实设备,模拟器中应用程序不会崩溃)和以前的型号。
代码崩溃了。
private lazy var progressViewMaskLayer: CAShapeLayer = {
let progressViewMaskLayer = CAShapeLayer()
progressViewMaskLayer.path = UIBezierPath(rect: CGRect(x: 0.0, y: 0.0, width: self.bounds.width - 8, height: self.bounds.width - 8)).CGPath
return progressViewMaskLayer
}()
private func setProgressViewHeight(height: CGFloat) {
let size = progressViewMaskLayer.frame.size
let origin = progressViewMaskLayer.frame.origin
progressViewMaskLayer.frame.size = CGSize(width: size.width, height: height) // CRASH HERE!
progressViewMaskLayer.frame.origin = CGPoint(x: origin.x, y: 64.0 - height)
}
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [0 nan]'