Slide 14
Slide 14 text
override func viewDidLoad() {
...
articles = realm.objects(Article).filter("user = %@", currentUser)
}
override func tableView(tableView: UITableView,
numberOfRowsInSection section: Int) -> Int {
return articles.count
}
override func tableView(tableView: UITableView,
cellForRowAtIndexPath indexPath: NSIndexPath)
-> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("",
forIndexPath: indexPath)
let article = articles[indexPath.row]
cell.title = article.title
cell.content = article.content
cell.username = article.user.name
return cell
}