skeleton collectionview

This commit is contained in:
Nihaal Sharma committed 2026-04-24 11:22:17 +01:00
1 parent da598df1c8
commit 1e1afe4d06
5 files changed
+84 -9

No files matched your search

@@ -0,0 +1,49 @@
//
// EmojiCollectionView.swift
// StickerSlack
//
// Created by neon443 on 24/04/2026.
//
import Foundation
import UIKit
import SwiftUI
struct EmojiCollectionView: UIViewRepresentable {
let hoarder: EmojiHoarder
let items: [String]
func makeUIView(context: Context) -> UICollectionView {
let collectionView = context.coordinator as UICollectionViewController
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "cell")
collectionView.collectionView.dataSource = context.coordinator
return collectionView.collectionView
}
func updateUIView(_ uiView: UICollectionView, context: Context) {
context.coordinator.hoarder = hoarder
context.coordinator.items = items
uiView.reloadData()
}
func makeCoordinator() -> Coordinator {
Coordinator(hoarder: hoarder, items: items)
}
final class Coordinator: UICollectionViewController {
var hoarder: EmojiHoarder
var items: [String]
init(hoarder: EmojiHoarder, items: [String]) {
self.hoarder = hoarder
self.items = items
super.init(collectionViewLayout: UICollectionViewFlowLayout())
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
}
@@ -0,0 +1,14 @@
//
// EmojiCollectionViewCell.swift
// StickerSlack
//
// Created by neon443 on 24/04/2026.
//
import Foundation
import UIKit
import SwiftUI
class EmojiCollectionViewCell: UICollectionViewCell {
}
+2 -2
View File
@@ -16,7 +16,7 @@ struct EmojiTableView: UIViewRepresentable {
func makeUIView(context: Context) -> UITableView {
let tableView = context.coordinator as UITableViewController
tableView.tableView.register(EmojiCell.self, forCellReuseIdentifier: "cell")
tableView.tableView.register(EmojiTableViewCell.self, forCellReuseIdentifier: "cell")
tableView.tableView.dataSource = context.coordinator
return tableView.tableView
}
@@ -50,7 +50,7 @@ struct EmojiTableView: UIViewRepresentable {
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! EmojiCell
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! EmojiTableViewCell
cell.selectionStyle = .none
guard !hoarder.trie.dict.isEmpty else {
@@ -9,7 +9,7 @@ import Foundation
import UIKit
import SwiftUI
class EmojiCell: UITableViewCell {
class EmojiTableViewCell: UITableViewCell {
private var spinner: UIActivityIndicatorView = UIActivityIndicatorView(style: .large)
private var hostingController: UIHostingController<StickerRow<EmojiHoarder>>?
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.