     let reuseIdentifierCell = "BillCell"
     let reuseIdentifierHeader = "BillHeader"
     
+    @IBOutlet weak var searchBar: UISearchBar!
+    
+    
     var managedObjectContext: NSManagedObjectContext? = nil
     var billSegue: Bill? = nil
     
     //Data
-    var data: [SubCategory] = []
+    var data: [SubCategory] = [] {
+        didSet {
+            self.collectionView.reloadData()
+        }
+    }
     
     override func viewDidLoad() {
         super.viewDidLoad()

                })
            }
        }
    }
}
    }
    
    func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
        if kind == UICollectionElementKindSectionHeader && !self.data[indexPath.section].bills.isEmpty {
            let header = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionHeader, withReuseIdentifier: reuseIdentifierHeader, forIndexPath: indexPath) as! BillHeaderView
            header.title.text = self.data[indexPath.section].name
            return header;
        }
        return UICollectionReusableView()
    }
    
