Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
https://github.com/realm-demos/RealmContent/issues/4
Browse files Browse the repository at this point in the history
  • Loading branch information
icanzilb committed Oct 4, 2017
1 parent 7ff6db6 commit fce691a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RealmContent/Core/View/ContentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public class ContentViewController: UIViewController, UITableViewDataSource, UIT
}
}

pageElementsUpdatesToken = page.elements.addNotificationBlock(applyChanges)
pageElementsUpdatesToken = page.elements
.filter(NSPredicate(format: "type in %@", ContentElement.Kind.allRawValues()))
.addNotificationBlock(applyChanges)
}

private func populateFrom(page: ContentPage) {
Expand All @@ -124,7 +126,7 @@ public class ContentViewController: UIViewController, UITableViewDataSource, UIT
}
}

private func applyChanges(_ changes: RealmCollectionChange<List<ContentElement>>) {
private func applyChanges(_ changes: RealmCollectionChange<Results<ContentElement>>) {
let section = 0

switch changes {
Expand Down

0 comments on commit fce691a

Please sign in to comment.