mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
fix remember selection on open issue
This commit is contained in:
1 file changed
+12
@@ -34,6 +34,18 @@ class MessagesPackListView: UITableViewController {
|
|||||||
tableView.reconfigureRows(at: indexPaths)
|
tableView.reconfigureRows(at: indexPaths)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
|
super.viewWillAppear(animated)
|
||||||
|
let selRow = UserDefaults.standard.integer(forKey: "selectedPackRowIndex")
|
||||||
|
let indexPath: IndexPath
|
||||||
|
if selRow == -1 {
|
||||||
|
indexPath = IndexPath(row: 0, section: 0)
|
||||||
|
} else {
|
||||||
|
indexPath = IndexPath(row: selRow, section: 1)
|
||||||
|
}
|
||||||
|
tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
|
||||||
|
}
|
||||||
|
|
||||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|||||||