mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
remade the imessageextension
updated recticon
This commit is contained in:
28
StickerSlackiMessageApp/StickerBrowserDataSource.swift
Normal file
28
StickerSlackiMessageApp/StickerBrowserDataSource.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// StickerBrowserDataSource.swift
|
||||
// StickerSlackiMessageExtension
|
||||
//
|
||||
// Created by neon443 on 29/10/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Messages
|
||||
|
||||
class StickerBrowserDataSource: NSObject, MSStickerBrowserViewDataSource {
|
||||
var hoarder: EmojiHoarder = EmojiHoarder(localOnly: true)
|
||||
|
||||
var emojis: [MSSticker] = []
|
||||
|
||||
func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int {
|
||||
guard emojis.isEmpty else { return emojis.count }
|
||||
for emoji in hoarder.emojis {
|
||||
guard let sticker = emoji.sticker else { continue }
|
||||
emojis.append(sticker)
|
||||
}
|
||||
return emojis.count
|
||||
}
|
||||
|
||||
func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker {
|
||||
return emojis[index]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user