Files
stickercloner/StickerCloner/StickerCloner MessagesExtension/StickerBrowserViewController.swift
Felix Förtsch 31040c3ca5 restructure as standalone iOS app + iMessage extension
convert container from Messages-only app to regular iOS app,
move shared code (models, api client, store) to Shared/ group,
add app group entitlements for cross-process data sharing,
rewrite StickerStore for shared UserDefaults + container,
create SwiftUI app entry point, simplify extension to read-only browser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:40:52 +01:00

28 lines
719 B
Swift

import Messages
import UIKit
final class StickerBrowserViewController: MSStickerBrowserViewController {
private var stickers: [MSSticker] = []
func reloadStickers() {
let urls = StickerStore.shared.stickerFileURLs()
stickers = urls.compactMap { url in
try? MSSticker(
contentsOfFileURL: url,
localizedDescription: url.deletingLastPathComponent().lastPathComponent
)
}
stickerBrowserView.reloadData()
}
// MARK: - MSStickerBrowserViewDataSource
override func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int {
stickers.count
}
override func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker {
stickers[index]
}
}