         self.openGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(openBottom))
     }
 
-    public var delegate: LayeredTableViewControllerDelegate? {
+    public weak var delegate: LayeredTableViewControllerDelegate? {
         didSet {
             self.view.setNeedsLayout()
         }

            self.bottomTableView.allowsSelection = isOpen
            self.openGestureRecognizer.isEnabled = !isOpen
        }
    }

    open override func viewDidLoad() {

#if os(iOS)
import UIKit

public protocol LayeredTableViewControllerDelegate: class {
    func bottomHeight(forLayeredTableViewController controller: LayeredTableViewController) -> CGFloat
    func contentInset(forLayeredTableViewController controller: LayeredTableViewController) -> UIEdgeInsets
}
