From d130d42b0bf29a42acf874b455063f241224721f Mon Sep 17 00:00:00 2001 From: tobias Date: Sat, 3 Oct 2020 15:56:23 +0200 Subject: [PATCH 1/4] Add constructor for storyboard to configure table style --- Source/QuickTableViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index f0c047d1..7613815c 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -67,6 +67,11 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI public required init?(coder: NSCoder) { super.init(coder: coder) } + + public required init?(coder: NSCoder, style: UITableView.Style) { + super.init(coder: coder) + tableView = UITableView(frame: .zero, style: style) + } deinit { tableView.dataSource = nil From fe6137eb158733ecc731fd77fc8beec4b1a1345d Mon Sep 17 00:00:00 2001 From: tobias Date: Sat, 3 Oct 2020 15:58:58 +0200 Subject: [PATCH 2/4] Cleanup constructor --- Source/QuickTableViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index 7613815c..30272696 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -68,7 +68,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI super.init(coder: coder) } - public required init?(coder: NSCoder, style: UITableView.Style) { + public init?(coder: NSCoder, style: UITableView.Style) { super.init(coder: coder) tableView = UITableView(frame: .zero, style: style) } From 40e2dfc3c7c330a173b84c0af6a446459f48a97d Mon Sep 17 00:00:00 2001 From: tobias Date: Sat, 3 Oct 2020 16:03:57 +0200 Subject: [PATCH 3/4] Fix lint issues --- Source/QuickTableViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index 30272696..a2753ca3 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -67,7 +67,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI public required init?(coder: NSCoder) { super.init(coder: coder) } - + public init?(coder: NSCoder, style: UITableView.Style) { super.init(coder: coder) tableView = UITableView(frame: .zero, style: style) From 36e52a08db56444ce85d1a8e62b0df6ff669a8a8 Mon Sep 17 00:00:00 2001 From: tobias Date: Sun, 4 Oct 2020 21:10:35 +0200 Subject: [PATCH 4/4] Make tableView open vor settings value, remove unnecessary constructor --- Source/QuickTableViewController.swift | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index a2753ca3..70dca1f9 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -33,7 +33,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI open var clearsSelectionOnViewWillAppear = true /// Returns the table view managed by the controller object. - open private(set) var tableView: UITableView = UITableView(frame: .zero, style: .grouped) + open var tableView: UITableView = UITableView(frame: .zero, style: .grouped) /// The layout of sections and rows to display in the table view. open var tableContents: [Section] = [] { @@ -68,11 +68,6 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI super.init(coder: coder) } - public init?(coder: NSCoder, style: UITableView.Style) { - super.init(coder: coder) - tableView = UITableView(frame: .zero, style: style) - } - deinit { tableView.dataSource = nil tableView.delegate = nil