Files
Woka_Native_iOS/WOKA/Authentication/Controller/LinkedChildVC.swift
BilalKhanWDI 3f2899b9a3 - Added api for child register
- Finalised the registration for parent
- Finalised the flow for above 16 and go the registeration completed.
- Added a View controller for showing the linked child.
2024-05-09 18:07:59 +05:30

63 lines
1.9 KiB
Swift

//
// LinkedChildVC.swift
// WOKA
//
// Created by MacBook Pro on 09/05/24.
//
import UIKit
class LinkedChildVC: UIViewController {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var nextBtn: LocalisedElementsButton!
var vm = LinkedChildVM()
override func viewDidLoad() {
super.viewDidLoad()
vm.vc = self
vm.initView()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
}
@IBAction func nextBtnTapped(_ sender: LocalisedElementsButton) {
let sb = UIStoryboard(name: K.StoryBoard.authenticationSB, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Authentication.userDetailsRegisterVC) as! UserDetailsRegisterVC
self.navigationController?.pushViewController(vc, animated: true)
}
}
// MARK: - TableView
extension LinkedChildVC : TableViewSRC{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return vm.linkedChilds.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Authentication.linkedChildCell, for: indexPath) as! LinkedChildCell
cell.setData(data: vm.linkedChilds[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath.row)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 100
}
}