     }
 
     func setupSearchBar() {
-        let searchController = UISearchController(searchResultsController: nil)
+        var searchController = UISearchController(searchResultsController: nil)
         searchController.dimsBackgroundDuringPresentation = false
         searchController.hidesNavigationBarDuringPresentation = true
 
         if #available(iOS 11.0, *) {
-            self.searchBar = searchController.searchBar
+            searchBar = searchController.searchBar
             navigationController?.navigationBar.prefersLargeTitles = false
             navigationItem.largeTitleDisplayMode = .never
 

            for obj in realm.objects(Subscription.self) {
                unread += obj.unread
            }
        }, completion: {
            self.navigationItem.backBarButtonItem = UIBarButtonItem(
                title: unread == 0 ? "" : "\(unread)",
                style: .plain,
                target: nil,

        guard let susbcriptions = Subscription.all() else { return }

        assigned = true
        subscriptionsToken = susbcriptions.observe({ [weak self] changes in
            self?.handleSubscriptionUpdates(changes: changes)
        })
    }

    // swiftlint:disable function_body_length cyclomatic_complexity
