scroll to top when shuffling

This commit is contained in:
Nihaal Sharma committed 2026-08-27 23:05:31 +05:30
1 parent c5ebe25ec2
commit 5a723075b3
2 files changed
+11

No files matched your search

@@ -53,6 +53,15 @@ class BrowseViewController: UINavigationController {
} }
@objc func shuffle() { @objc func shuffle() {
guard let tableView = self.tableView.tableView else { return }
let safeAreaInsets = tableView.safeAreaInsets
tableView.setContentOffset(
CGPoint(
x: CGFloat(-safeAreaInsets.left),
y: CGFloat(-safeAreaInsets.top)
),
animated: true
)
self.refreshUI(withItems: getItems().shuffled()) self.refreshUI(withItems: getItems().shuffled())
} }
} }
@@ -79,6 +79,8 @@ final class EmojiTableView: UITableViewController {
guard let emoji = hoarder.trie.dict[itemIdentifier] else { return cell } guard let emoji = hoarder.trie.dict[itemIdentifier] else { return cell }
cell.configure(with: hoarder, emoji: emoji) cell.configure(with: hoarder, emoji: emoji)
tableView.separatorInset = UIEdgeInsets(top: 0, left: cell.bounds.height + 8, bottom: 0, right: 16)
return cell return cell
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.