I'm new in Swift, i am using video lessons. But in current lesson i have an issue, and i can't solve it by myself.
The issue is with new #selector syntax in NSNotificationCenter, i used the old syntax and it didn't work.
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
NSNotificationCenter.defaultCenter().addObserver(self, selector: "onPostsLoaded:", name: "postsLoaded", object: nil)
tableView.reloadData()
}
func onPostsLoaded(notif:AnyObject) {
tableView.reloadData()
}
}
Please check the Screenshot:How should I rewrite the yellow code (with selector) to make it work?
Thanks in advance