Observer
public class Observer
An opaque object that serves as a reference to a change subscription on a Box or Query. Keep a strong reference to this object (in a property or a global) as long as you want to receive callbacks. Let this object deinit to cancel your subscription.
You obtain an Observer from one of a Box
‘s or Query
’s subscribe()
methods.
-
Terminate your subscription. This object will automatically call this method when it is deinited, but since not using an object in Swift can lead to warnings, this method is provided so you can unsubscribe explicitly and make the Swift compiler aware the object is being used.
Declaration
Swift
public func unsubscribe()