You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My delegate calls (gfd.geofireAdded(snapshot:) and gfd.geofireRemove(key: currentKey)) are working great... but during the lifecycle of my app from the viewController that is initializing this manager, I call the following function (and set the manager to nil) to remove the observers and deinit the manager class:
internalfunc removeGeofireObservers(){
if regionQuery !=nil{
if regionKeyEntered !=nil{
regionQuery?.removeObserver(withFirebaseHandle: regionKeyEntered!)
regionKeyEntered =nil}
if regionKeyExited !=nil{
regionQuery?.removeObserver(withFirebaseHandle: regionKeyExited!)
regionKeyExited =nil}
regionQuery?.removeAllObservers()
regionQuery =nil}
if circleQuery !=nil{
circleQuery?.removeAllObservers()
circleQuery =nil}}
I've verified that the deinit {} method is called on the manager object and I would expect that the observers and all their data would have gone away in this process... but shortly later when I reinitialize the manager object and setup the observers again, none of the .keyEntered observers are fired UNLESS I move the map and update the region (at which point .keyExited is fired on all the items that were there before) and then move back and update to the previous region (at which point .keyEntered is fired again)...
Am I doing something wrong here? Why when I remove the observers and even deinit the parent class, does the data not totally refresh when I try it again at a later time?
The text was updated successfully, but these errors were encountered:
Inside a "manager" class, I'm creating two observers (one fore each .keyEntered and .keyExited) using a region query:
My delegate calls (
gfd.geofireAdded(snapshot:)
andgfd.geofireRemove(key: currentKey)
) are working great... but during the lifecycle of my app from the viewController that is initializing this manager, I call the following function (and set the manager to nil) to remove the observers and deinit the manager class:I've verified that the
deinit {}
method is called on the manager object and I would expect that the observers and all their data would have gone away in this process... but shortly later when I reinitialize the manager object and setup the observers again, none of the.keyEntered
observers are fired UNLESS I move the map and update the region (at which point.keyExited
is fired on all the items that were there before) and then move back and update to the previous region (at which point.keyEntered
is fired again)...Am I doing something wrong here? Why when I remove the observers and even deinit the parent class, does the data not totally refresh when I try it again at a later time?
The text was updated successfully, but these errors were encountered: