deselect row when come back
This commit is contained in:
parent
ba095c6a2f
commit
e84d0eba04
1 changed files with 7 additions and 1 deletions
|
|
@ -56,6 +56,13 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
||||||
view.addSubview(searchBarView)
|
view.addSubview(searchBarView)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
|
super.viewWillAppear(animated)
|
||||||
|
if let path = tableView.indexPathForSelectedRow {
|
||||||
|
tableView.deselectRow(at: path, animated: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func numberOfSections(in tableView: UITableView) -> Int {
|
func numberOfSections(in tableView: UITableView) -> Int {
|
||||||
return sections.count
|
return sections.count
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +108,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
||||||
if commonPrefix.characters.count == 0 {
|
if commonPrefix.characters.count == 0 {
|
||||||
let firstCharacter = name[name.startIndex]
|
let firstCharacter = name[name.startIndex]
|
||||||
let newSection = (index: index, length: i - index, title: "\(firstCharacter)")
|
let newSection = (index: index, length: i - index, title: "\(firstCharacter)")
|
||||||
print("index: \(index), length: \(newSection.length), title: \(newSection.title)")
|
|
||||||
sections.append(newSection)
|
sections.append(newSection)
|
||||||
index = i
|
index = i
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue