add clear button

This commit is contained in:
Max Sokolov 2018-03-16 23:54:33 +03:00
parent d8ae329118
commit 23b51227fd
1 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,15 @@ class AutolayoutCellsController: UIViewController {
} }
tableDirector += section 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 { func getViewHeight(view: UIView, width: CGFloat) -> CGFloat {