Decrement the static row count instead of using hard-coded values
This commit is contained in:
parent
1271fc9081
commit
633e291c2e
|
@ -126,11 +126,12 @@ class AddFeedViewController: UITableViewController, AddContainerViewControllerCh
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||||
if section == 1 {
|
let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: section)
|
||||||
return shouldDisplayPicker ? 2 : 1
|
if section == 1 && !shouldDisplayPicker {
|
||||||
|
return defaultNumberOfRows - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, numberOfRowsInSection: section)
|
return defaultNumberOfRows
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,11 +64,12 @@ class AddFolderViewController: UITableViewController, AddContainerViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||||
|
let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: section)
|
||||||
if section == 1 && !shouldDisplayPicker {
|
if section == 1 && !shouldDisplayPicker {
|
||||||
return 1
|
return defaultNumberOfRows - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, numberOfRowsInSection: section)
|
return defaultNumberOfRows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue