I have two containers in a view. The top one has a collection view. I want to update my collection view from a button when a button is hit from the below container. My butto
Swift 4:
1st class:
NotificationCenter.default.post(name: NSNotification.Name("load"), object: nil)
Class with collectionView:
in viewDidLoad():
NotificationCenter.default.addObserver(self, selector: #selector(loadList(notification:)), name: NSNotification.Name(rawValue: "load"), object: nil)
and function:
@objc func loadList(notification: NSNotification) {
self.collectionView.reloadData()
}