Skip to content

Instantly share code, notes, and snippets.

@DiganVaghasiya
Created October 23, 2020 12:43
Show Gist options
  • Select an option

  • Save DiganVaghasiya/abb6de864e1adea652ede40bd116c069 to your computer and use it in GitHub Desktop.

Select an option

Save DiganVaghasiya/abb6de864e1adea652ede40bd116c069 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
let addNewEmpVC = storyboard?.instantiateViewController(withIdentifier: "addNewEmpVC") as! addNewEmpVC
addNewEmpVC.selectedIndex = indexPath.row
addNewEmpVC.EmpDictionary = arrEmployee[indexPath.row]
arrEmployee.isEdit = true
self.navigationController?.pushViewController(addNewEmpVC, animated: true)
}
Then check condition in submit data view controller’s viewDidLaad( ) : -
override func viewDidLoad() {
super.viewDidLoad ( )
self.navigationController?.navigationItem.setHidesBackButton
(true, animated: false)
if isEdit == true{
txtName.text = self.EmpDictionary["EmpName"]
txtEmail.text = self.EmpDictionary["EmpEmail"]
txtContact.text = self.EmpDictionary[ "EmpContact"]
txtdesignation.text = self.EmpDictionary["EmpDesignation"]
let url = directoryURLGettingImage(strNAme: EmpDictionary[ "Profile" ]! as! String)
let imgdata = try!Data(contentsOf: url as! URL)
if imgdata != nil
{
self.imgview.image = UIImage(data: imgdata)
}
} else{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment