From 23b51227fd281f0cd8128acf3df5128d4b56c210 Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Fri, 16 Mar 2018 23:54:33 +0300 Subject: [PATCH] add clear button --- .../Controllers/AutolayoutCellsController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Demo/Classes/Presentation/Controllers/AutolayoutCellsController.swift b/Demo/Classes/Presentation/Controllers/AutolayoutCellsController.swift index 94c7eeb..4ad780d 100644 --- a/Demo/Classes/Presentation/Controllers/AutolayoutCellsController.swift +++ b/Demo/Classes/Presentation/Controllers/AutolayoutCellsController.swift @@ -56,6 +56,15 @@ class AutolayoutCellsController: UIViewController { } tableDirector += section + + navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Clear", style: .done, target: self, action: #selector(clear)) + } + + @objc + func clear() { + + tableDirector.clear() + tableDirector.reload() } func getViewHeight(view: UIView, width: CGFloat) -> CGFloat {