You can't invalidate the NSTimer in `deinit`, as `deinit` is never called since the NSTimer has a strong reference to the target, the controller. Invalidate the timer in something else, like `viewDidDisappear`. (Thanks Chris Hubert!)
You can't invalidate the NSTimer in
deinit, asdeinitis never called since the NSTimer has a strong reference to the target, the controller.Invalidate the timer in something else, like
viewDidDisappear.(Thanks Chris Hubert!)