From fce691ab12ac3282510ca060bb53cf4ed3665c44 Mon Sep 17 00:00:00 2001 From: Marin Todorov Date: Wed, 4 Oct 2017 10:57:01 +0200 Subject: [PATCH] https://github.com/realm-demos/RealmContent/issues/4 --- RealmContent/Core/View/ContentViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RealmContent/Core/View/ContentViewController.swift b/RealmContent/Core/View/ContentViewController.swift index ef9eb82..75a7948 100644 --- a/RealmContent/Core/View/ContentViewController.swift +++ b/RealmContent/Core/View/ContentViewController.swift @@ -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) { @@ -124,7 +126,7 @@ public class ContentViewController: UIViewController, UITableViewDataSource, UIT } } - private func applyChanges(_ changes: RealmCollectionChange>) { + private func applyChanges(_ changes: RealmCollectionChange>) { let section = 0 switch changes {