mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
army of spinners
This commit is contained in:
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")
|
||||
}
|
||||
}
|
||||