kaandedeoglu / KDCircularProgress

A circular progress view with gradients written in Swift
MIT License
1.21k stars 217 forks source link

Window is nil when push or present to another view controller #7

Closed vanthang91 closed 9 years ago

vanthang91 commented 9 years ago

Hi Kaandedeoglu, I used this lib to show circular progress view on a view controller and after finishing animation, I want to push or present to another view controller, app is crashed because new window is nil. This bug is here: public override func didMoveToWindow() { progressLayer.contentsScale = window!.screen.scale } It should be: public override func didMoveToWindow() { if let window = window { progressLayer.contentsScale = window.screen.scale } } Best regards !

vanthang91 commented 9 years ago

Sr I used old version, you fixed it. Thanks