objectbox / objectbox-swift

Swift database - fast, simple and lightweight (iOS, macOS)
https://swift.objectbox.io
Apache License 2.0
465 stars 30 forks source link

Filter with observer #21

Closed daoan1412 closed 5 years ago

daoan1412 commented 5 years ago

How can I create a subscription with filter by property?

// this fetch all items when data changed
box.subscribe { allItems, _ in

 }

p/s: My mistake: Follow this example https://github.com/objectbox/objectbox-swift/blob/master/Example/NotesExample-iOS/NotesOverviewViewController.swift

uli-objectbox commented 5 years ago

Ah, I see you figured out by yourself that you can call subscribe on a Query object for that.

Happy coding! 😀