//
//  AddAddressVC2.swift
//  Garmentoo
//
//  Created by Vijith on 20/04/22.
//

import UIKit

class AddAddressVC2: UIViewController {
    
    @IBOutlet weak var nameTF:UITextField!
    @IBOutlet weak var add1TF:UITextField!
    @IBOutlet weak var add2TF:UITextField!
    @IBOutlet weak var pinTF:UITextField!
    @IBOutlet weak var landmarkTF:UITextField!
    
    @IBOutlet weak var headerTitle:UILabel!
    
    let padding : CGFloat = 15.0
    var currentName = ""
    var currentAddress = ""
    var header = "Add Address"

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        setui()
    }
    
    func setui()
    {
        
        let textFields = [nameTF,add1TF,add2TF,pinTF,landmarkTF]
//        self.nameTF.setLeftPaddingPoints(padding)
//        self.add1TF.setLeftPaddingPoints(padding)
//        self.add2TF.setLeftPaddingPoints(padding)
//        self.pinTF.setLeftPaddingPoints(padding)
//        self.landmarkTF.setLeftPaddingPoints(padding)
        
        textFields.forEach {$0?.setLeftPaddingPoints(padding)}
        textFields.forEach{
            $0?.backgroundColor = UIColor.viewBg
        }
        
        self.nameTF.text = self.currentName
        self.add1TF.text = self.currentAddress
        
        self.headerTitle.text = header
    }
    

    @IBAction func OnTapSubmitBtn(_ sender: Any) {
        self.navigationController?.popViewController(animated: true)
    }
    @IBAction func OnTapBackBtn(_ sender: Any) {
        self.navigationController?.popViewController(animated: true)
    }
    
}
