Device Verification: Verify screen: display emojis

This commit is contained in:
manuroe
2019-04-07 00:01:19 +02:00
parent b9dd830df8
commit 2d18b75844
6 changed files with 130 additions and 4 deletions
@@ -19,7 +19,7 @@
import UIKit
final class DeviceVerificationVerifyViewController: UIViewController {
// MARK: - Constants
private enum Constants {
@@ -191,3 +191,30 @@ extension DeviceVerificationVerifyViewController: DeviceVerificationVerifyViewMo
self.render(viewState: viewSate)
}
}
extension DeviceVerificationVerifyViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
guard let emojis = self.viewModel.emojis else {
return 0
}
return emojis.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "VerifyEmojiCollectionViewCell", for: indexPath) as? VerifyEmojiCollectionViewCell else {
return UICollectionViewCell()
}
guard let emoji = self.viewModel.emojis?[indexPath.row] else {
return UICollectionViewCell()
}
cell.emoji.text = emoji.emoji
cell.name.text = emoji.name
return cell
}
}