Added multilevel window support for stacked presentation #385
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.
Issue Link 🔗
How to display two view the same time by using SwiftEntry ? #340
Goals 🥅
Presenting multiple entries on different window levels at the same time.
Entries with the same window level attribute should be presented the same way as before, holding the queue logic same for the same window level. But different window levels should be able to stack on top of each other. Thus creating a window level hierarchy for entries.
Implementation Details ✏️
EKWindowProvider was a singleton, capable of holding only one window. The window level was being set when the new entry was being prepared to be presented.
I have removed the shared instance and created a static dictionary which holds the EKWindowProvider instances for different window levels. When the entry is requested to present, if there is a window provider instance present in the dictionary for the window level of that entry (read from it's attributes), that instance is being used for presentation. If not, a new EKWindowProvider instance is being initiated for that window level and being stored in the dictionary. When the last entry for a window level has been dismissed, the provider for that level is also being removed from the dictionary for memory management purposes.
All the presentation and dismissal logic has also been updated accordingly.
Testing Details 🔍
I have done some superficial tests and may need deeper testing for any functionalities may have been effected. In my tests, all the basics were working good.
Screenshot Links 📷