kaandedeoglu / KDCircularProgress

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

Fix optional unwrap error when calling removeFromSuperview #1

Closed justwudi closed 9 years ago

justwudi commented 9 years ago

Added a check as window can be nil in didMoveToWindow, which causes an error when removeFromSuperview is called. (Source: Apple)

kaandedeoglu commented 9 years ago

Of course, good catch. Can you please use optional unwrapping (if let window = window ...) instead of the ! operator and I will merge it. Thanks