//
//  AddressListVC.swift
//  Garmentoo
//
//  Created by ANGEL FS on 31/03/22.
//

import UIKit

class AddressListVC: UIViewController {

    @IBOutlet weak var addressTable: UITableView!
    
    var menuSelectedIndex = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()

        self.viewLoadingProperties()
    }

    //Button actions
    @IBAction func backBtnTapped(_ sender: Any) {
        self.navigationController?.popViewController(animated: true)
    }
}

extension AddressListVC
{
    func viewLoadingProperties()
    {
        self.addressTable.register(UINib(nibName: "AddressListTVC", bundle: nil), forCellReuseIdentifier: "addressListCell")
    }
    
    @objc func tableCellMenuAction()
    {
        
    }
}


extension AddressListVC : UITableViewDelegate, UITableViewDataSource
{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 5
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "addressListCell")as! AddressListTVC
        cell.menuBtn.tag = indexPath.row
        cell.menuCloseBtn.tag = indexPath.row
        cell.menuBtn.addTarget(self, action: #selector(tableCellMenuAction), for: .touchUpInside)
        
        return cell
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 100
    }
    
}
