Last active
October 12, 2017 08:46
-
-
Save OctoberHammer/897864b37a961714ef0289a5db54da95 to your computer and use it in GitHub Desktop.
azeml.swift #swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewControllerAdd: UIViewController { | |
var delegate : DataTableView? | |
@IBAction func exittoVC(_ sender: Any) { | |
delegate?.relodeTableView() | |
self.dismiss(animated: true, completion: nil) | |
} | |
} | |
class ViewControllerTable: UIViewController,UITableViewDelegate, UITableViewDataSource , DataTableView { | |
@IBOutlet weak var menubar: UINavigationItem! | |
@IBOutlet weak var menuView: UIView! | |
@IBOutlet weak var tableViewFirst: UITableView! | |
@IBOutlet weak var menuconst: NSLayoutConstraint! | |
@IBOutlet weak var tableViewMenu: UITableView! | |
var menuSwowing = false | |
var indexmenu :Int = 0 | |
var ItemsSelling: [Selling] = [] | |
var ItemsOrder: [Order] = [] | |
var ItemsCoordination: [Coordination] = [] | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
} | |
override func viewWillAppear(_ animated: Bool) { | |
self.tableViewFirst.reloadData() | |
} | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
var countS : Int = 0 | |
if (tableView == tableViewFirst && indexmenu == 0){ | |
countS = ItemsSelling.count | |
}else if(tableView == tableViewFirst && indexmenu == 1){ | |
countS = ItemsOrder.count | |
}else if(tableView == tableViewFirst && indexmenu == 2){ | |
countS = ItemsCoordination.count | |
}else if (tableView == tableViewMenu){ | |
countS = 3 | |
} | |
return countS | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
if (tableView == tableViewFirst){ | |
return navigator(indexM : indexmenu,tableView: tableView) | |
}else if (tableView == tableViewMenu){ | |
guard let cellMenu = tableView.dequeueReusableCell(withIdentifier: "CellMenu") as? MenuCell else { | |
return UITableViewCell() | |
} | |
cellMenu.tabnameMenuCell.text = casestr(indextab: indexPath.row) | |
cellMenu.layer.borderWidth = 1.0 | |
cellMenu.layer.borderColor = UIColor.gray.cgColor | |
return cellMenu | |
} | |
return UITableViewCell() | |
} | |
func relodeTableView() { | |
print("1") | |
self.tableViewFirst.reloadData() | |
} | |
} | |
protocol DataTableView { | |
func relodeTableView() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment