mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
got a split sticker picker setup, blank sticker pane tho
added messagesrootviewcontroller for the split pane thingy added messagespacklistview to select packs n stuff added .description to packs for easier display updated stickerdatasource to take a pack for filtering messagesvc needs to be cleaned ps i tried a splitviewcontroller but it didnt do the split
This commit is contained in:
11 files changed
+252
-18
No files matched your search
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// MessagesPackListView.swift
|
||||
// StickerSlackiMessageApp
|
||||
//
|
||||
// Created by neon443 on 24/07/2026.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
class MessagesPackListView: UITableViewController {
|
||||
var emojiHoarder: EmojiHoarder!
|
||||
var onSelect: ((EmojiPack) -> Void)?
|
||||
|
||||
init(hoarder: EmojiHoarder) {
|
||||
self.emojiHoarder = hoarder
|
||||
super.init(style: .plain)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func packFor(indexPath: IndexPath) -> EmojiPack? {
|
||||
guard emojiHoarder.emojiPacks.indices.contains(indexPath.row) else { return nil }
|
||||
return emojiHoarder.emojiPacks[indexPath.row]
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
// self.splitViewController?.preferredPrimaryColumnWidth = UIScreen.main.bounds.width/4
|
||||
return
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return emojiHoarder.emojiPacks.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = UITableViewCell()
|
||||
var config = cell.defaultContentConfiguration()
|
||||
|
||||
if let pack = packFor(indexPath: indexPath) {
|
||||
config.text = pack.name
|
||||
config.secondaryText = pack.description
|
||||
config.textProperties.font = UIFont.systemFont(ofSize: 14)
|
||||
config.secondaryTextProperties.font = UIFont.systemFont(ofSize: 14)
|
||||
}
|
||||
|
||||
cell.contentConfiguration = config
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
onSelect?(emojiHoarder.emojiPacks[indexPath.row])
|
||||
}
|
||||
}
|
||||