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

Commit

Permalink
Merge pull request #9 from realm-demos/mt/issue-4
Browse files Browse the repository at this point in the history
Hides non-standard page elements
  • Loading branch information
icanzilb authored Oct 4, 2017
2 parents 64c1b6a + fce691a commit 179e0d7
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 179e0d7

Please sign in to comment.