diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index 4548b70..4a9d3a6 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -123,6 +123,11 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate, UIActionShe } } + deinit { + pagingScrollView = nil + NSNotificationCenter.defaultCenter().removeObserver(self) + } + func setup() { applicationWindow = (UIApplication.sharedApplication().delegate?.window)! @@ -244,14 +249,6 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate, UIActionShe isViewActive = true } - public override func viewDidDisappear(animated: Bool) { - super.viewDidDisappear(true) - - pagingScrollView = nil - visiblePages = Set() - NSNotificationCenter.defaultCenter().removeObserver(self) - } - public override func prefersStatusBarHidden() -> Bool { if isForceStatusBarHidden { return true