army of spinners

This commit is contained in:
Nihaal Sharma committed 2026-04-24 17:41:06 +01:00
1 parent c643e3d8c4
commit 6ac4166283
2 files changed
+28

No files matched your search

@@ -44,6 +44,16 @@ struct EmojiCollectionView: UIViewRepresentable {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
return cell
}
}
}
@@ -10,5 +10,23 @@ import UIKit
import SwiftUI
class EmojiCollectionViewCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
let spinner = UIActivityIndicatorView()
spinner.frame = frame
spinner.startAnimating()
self.contentView.addSubview(spinner)
spinner.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
spinner.topAnchor.constraint(equalTo: contentView.topAnchor),
spinner.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
spinner.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
spinner.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)
])
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
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.