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>
28 lines
719 B
Swift
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]
|
|
}
|
|
}
|