From 5ea063520775e986c25d835045bd3cf882b6aba7 Mon Sep 17 00:00:00 2001 From: suzuki_keishi Date: Wed, 13 Jan 2016 13:56:01 +0900 Subject: [PATCH] [bug fix]mail crash. --- SKPhotoBrowser/SKPhotoBrowser.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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