Skip to content

Commit 25821fa

Browse files
committed
Removed unnecessary code
1 parent 5d6c1be commit 25821fa

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/Product Settings/Menu Order/ProductMenuOrderViewController.swift

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class ProductMenuOrderViewController: UIViewController {
4646

4747
override func viewDidAppear(_ animated: Bool) {
4848
super.viewDidAppear(animated)
49-
configureTextFieldFirstResponder()
49+
configureFirstTextFieldAsFirstResponder()
5050
}
5151
}
5252

@@ -71,11 +71,16 @@ private extension ProductMenuOrderViewController {
7171

7272
tableView.backgroundColor = .listBackground
7373
tableView.removeLastCellSeparator()
74+
75+
tableView.sectionHeaderHeight = UITableView.automaticDimension
76+
tableView.sectionFooterHeight = UITableView.automaticDimension
77+
78+
tableView.allowsSelection = false
7479
}
7580

7681
/// Since there is only a text field in this view, the text field become the first responder immediately when the view did appear
7782
///
78-
func configureTextFieldFirstResponder() {
83+
func configureFirstTextFieldAsFirstResponder() {
7984
if let indexPath = sections.indexPathForRow(.menuOrder) {
8085
let cell = tableView.cellForRow(at: indexPath) as? TextFieldTableViewCell
8186
cell?.textField.becomeFirstResponder()
@@ -108,17 +113,6 @@ extension ProductMenuOrderViewController: UITableViewDataSource {
108113
// MARK: - UITableViewDelegate Conformance
109114
//
110115
extension ProductMenuOrderViewController: UITableViewDelegate {
111-
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
112-
tableView.deselectRow(at: indexPath, animated: true)
113-
}
114-
115-
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
116-
return UITableView.automaticDimension
117-
}
118-
119-
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
120-
return UITableView.automaticDimension
121-
}
122116

123117
func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
124118
return sections[section].footer

0 commit comments

Comments
 (0)