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
Here are some design considerations around the manual showing:
On showing: if NFX.started - I check this value in the new method, showManually() NFX.presented = true - At this point Netfox will no longer control whether the window has already been presented, that is the job of the new presenter. If Netfox is asked to show using show(), it will (and should) do so.
On hiding: if !NFX.presented - Same as above, Netfox is no longer in charge if they used showManually() NotificationCenter.default.post - If the user wishes to deactivate the search window on disappearing, they are free to do so. The notification has been publicly exposed. I'd love to have more discussion as to why we (Netfox) even needs to do this. At first glance, it seems like we're having a memory leak. Once the window is shown and dismissed, whether the search controller is active shouldn't matter anymore, it should be deallocated. NFX.lastVisitDate - I moved this logic into NFXListController's ViewWillDisappear method. It makes a little more sense to do so, since NFXListController is the only one that cares about it. I left the actual property in NFX, simply because another class might be interested in this value as well (in the future)
I'd love to have more discussion as to why we (Netfox) even needs to do this. At first glance, it seems like we're having a memory leak. Once the window is shown and dismissed, whether the search controller is active shouldn't matter anymore, it should be deallocated.
There was a bug when the search controller was active and you tried to hide the netfox. Search controller never removed from the screen. In order to workaround on this, we added the notification.
If you want to reproduce the old issue get the master, comment the self.searchController.isActive = false in the NFXListController_iOS, shake - open the netfox, perform a search and shake again - search screen is not being removed. If you shake again netfox will appear again above the stacked search screen (as the internal presented state has changed).
In 5480bf9 I have removed all the search notifications and now I'm trying to solve the same issue by using the self.definesPresentationContext = YES; which works well but has some side effects: when you tap on a search result and return back to the list the results move under the search bar.
Let me know if it is clear enough and if you have any idea about the side effect issue 👍 🍺
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a suggested fix for issue #36.
Here are some design considerations around the manual showing:
On showing:
if NFX.started- I check this value in the new method,showManually()NFX.presented = true- At this point Netfox will no longer control whether the window has already been presented, that is the job of the new presenter. If Netfox is asked to show usingshow(), it will (and should) do so.On hiding:
if !NFX.presented- Same as above, Netfox is no longer in charge if they usedshowManually()NotificationCenter.default.post- If the user wishes to deactivate the search window on disappearing, they are free to do so. The notification has been publicly exposed. I'd love to have more discussion as to why we (Netfox) even needs to do this. At first glance, it seems like we're having a memory leak. Once the window is shown and dismissed, whether the search controller is active shouldn't matter anymore, it should be deallocated.NFX.lastVisitDate- I moved this logic intoNFXListController'sViewWillDisappearmethod. It makes a little more sense to do so, sinceNFXListControlleris the only one that cares about it. I left the actual property in NFX, simply because another class might be interested in this value as well (in the future)