From ea467127817841249acba0e7b0e7bb0be60ce334 Mon Sep 17 00:00:00 2001 From: nghialv Date: Fri, 22 Jan 2016 11:14:05 +0900 Subject: [PATCH] set delegate and datasource to nil when deinit --- Source/Hakuba.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Hakuba.swift b/Source/Hakuba.swift index 0e1cbd2..e04f07e 100644 --- a/Source/Hakuba.swift +++ b/Source/Hakuba.swift @@ -56,6 +56,11 @@ public class Hakuba : NSObject { tableView.dataSource = self } + deinit { + tableView?.delegate = nil + tableView?.dataSource = nil + } + public func deselectAllCells() { for cell in selectedCells { if let cellmodel = (cell as? MYTableViewCell)?.cellModel {