Files
Woka_Native_iOS/WOKA/Authentication/Controller/SelectAvatarVC.swift

73 lines
2.4 KiB
Swift
Raw Normal View History

2024-05-02 19:27:51 +05:30
//
// SelectAvatarVC.swift
// WOKA
//
// Created by MacBook Pro on 02/05/24.
//
import UIKit
class SelectAvatarVC: UIViewController {
2024-05-02 19:30:09 +05:30
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var nextBtn: LocalisedElementsButton!
2024-05-02 19:30:09 +05:30
var vm = SelectAvatarVM()
2024-05-02 19:27:51 +05:30
override func viewDidLoad() {
super.viewDidLoad()
2024-05-02 19:30:09 +05:30
vm.vc = self
vm.initView()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
2024-05-02 19:27:51 +05:30
}
2024-05-02 19:30:09 +05:30
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
}
2024-05-02 19:30:09 +05:30
}
2024-05-02 19:27:51 +05:30
2024-05-02 19:30:09 +05:30
// MARK: - CollectionView Delegate
2024-05-02 19:27:51 +05:30
2024-05-02 19:30:09 +05:30
extension SelectAvatarVC : UICollectionViewDelegate , UICollectionViewDataSource{
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 10
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: K.CellIdentifier.Authentication.selectAvatarCell, for: indexPath) as! SelectAvatarCell
cell.setData()
return cell
2024-05-02 19:27:51 +05:30
}
2024-05-02 19:30:09 +05:30
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
}
}
2024-05-02 19:27:51 +05:30
2024-05-02 19:30:09 +05:30
// MARK: - Collection Flow Layout
extension SelectAvatarVC : UICollectionViewDelegateFlowLayout{
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 10
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let noOfItems = self.collectionView.frame.width
let size = ((noOfItems / 3) - 10)
return CGSize(width: size, height: size)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}
2024-05-02 19:27:51 +05:30
}