Guest User

Untitled

a guest
Oct 18th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. (self.presentedViewController as! tableViewController).table.reloadData()
  2.  
  3. (self.navigationController!.viewControllers[self.navigationController!.viewControllers.count - 2] as! tableViewController).table.reloadData()
  4.  
  5. extension Notification.Name {
  6. static let reload = Notification.Name("reload")
  7. }
  8.  
  9. NotificationCenter.default.post(name: .reload, object: nil)
  10.  
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. NotificationCenter.default.addObserver(self, selector: #selector(reloadTableData), name: .reload, object: nil)
  14. }
  15.  
  16. @objc func reloadTableData(_ notification: Notification) {
  17. tableView.reloadData()
  18. }
Add Comment
Please, Sign In to add comment