Optimizely retains part of our view hierarchy and won't let go
Our app destroys most of its UI view hierarchy when the user "logs out" and returns to a kind of welcome/login screen.
We have asserts in the code to ensure that no instances of certain views are alive after the user has logged out. (If they were alive they might do things that we don't want while the user is logged out.)
Recently we noticed that these asserts started firing after logging out. We discovered that removing the Optimizely SDK fixed the issue.
It does not seem to happen in our older versions of the app that supports iOS 7 and iOS 8, though that may be a coincidence.
The issue only happens if the app is put in the background and then brought back to the foreground while the user is logged in. If you don't put the app in the background you can use it and log out without any asserts firing. Perhaps UIApplicationDidEnterBackground or UIApplicationWillEnterForeground causes Optimizely to retain parts of our view hierarchy, keeping it alive after the user logs out.
Is there a way to A) cleanly shut down Optimizely and guarantee nothing is retained after that point, or B) fix what would seem to be a bug in the SDK?
Thanks for bringing this potential bug to our attention. Our Engineering team is looking into it to see if there is a fix.
Would you be able to try reproducing this with [Optimizely disableSwizzle]; before startOptimizely?
@mtaube Sorry for the delay in response here — I did not receive a notification for your question and just happened to stumble upon it when Googling.
This view hierachy retaining issue was address in SDK 1.6.0. Are you still having this issue? If so, which version of the SDK are you using?