Skip to content

Instantly share code, notes, and snippets.

View DiganVaghasiya's full-sized avatar

DiganVaghasiya DiganVaghasiya

View GitHub Profile
func save( )
{
if isEdit == true
{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
let addNewEmpVC = storyboard?.instantiateViewController(withIdentifier: "addNewEmpVC") as! addNewEmpVC
//variables for update data
var isEdit = false
var selectedIndex : Int = 0
var EmpDictionary : [String:Any] = [:]
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)
{
if editingStyle == .delete
{
func save( )
{
if isEdit == true
{
//variables for update data
var isEdit = false
var selectedIndex : Int = 0
var EmpDictionary : [String:Any] = [:]
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)
{
if editingStyle == .delete
{
func tableView(_ tableView: UITableView, heightForRowAtindexPath : IndexPath) -> CGFloat {
return 120
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrEmployee.count
}
func getpath()->String
{
let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String