From 6505f450743b0f3abc49e26cc95ddec952209bf9 Mon Sep 17 00:00:00 2001 From: Nihaal Sharma <69979447+neon443@users.noreply.github.com> Date: Thu, 27 Aug 2026 23:12:55 +0530 Subject: [PATCH] reorder in pack list --- StickerSlack/EmojiHoarder/EmojiHoarder.Packs.swift | 6 ++++++ StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/StickerSlack/EmojiHoarder/EmojiHoarder.Packs.swift b/StickerSlack/EmojiHoarder/EmojiHoarder.Packs.swift index 9660887..fbb49f4 100644 --- a/StickerSlack/EmojiHoarder/EmojiHoarder.Packs.swift +++ b/StickerSlack/EmojiHoarder/EmojiHoarder.Packs.swift @@ -69,4 +69,10 @@ extension EmojiHoarder { } saveEmojiPacks() } + + func moveEmojiPack(from: IndexPath, to: IndexPath) { + let removed = emojiPacks.remove(at: from.row) + emojiPacks.insert(removed, at: to.row) + saveEmojiPacks() + } } diff --git a/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift b/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift index fd736d1..4ba71e2 100644 --- a/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift +++ b/StickerSlack/UIKit/EmojiPacks/EmojiPackListView.swift @@ -220,7 +220,7 @@ class EmojiPackListView: UITableViewController { } override func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { - print(tableView, sourceIndexPath, destinationIndexPath) + self.emojiHoarder.moveEmojiPack(from: sourceIndexPath, to: destinationIndexPath) } override func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {