Support for multiple SwiftEntryKit instances working in parallel #366
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 🔗
No issue.
Goals 🥅
Support for multiple SwiftEntryKit instances working in parallel. No API breaking changes!
These changes allow the programmer to create separate instances and use them at the same time.
For example: an alert and a toast can be shown at the same time, as long as they are displayed by different SwiftEntryKit instances, and their windowLevel differs.
Implementation Details ✏️
SwiftEntryKit initializer made public.
Move logic from SwiftEntryKit class functions to instance functions.
SwiftEntryKit class functions now call a their instance counterpart on a new
public static let shared: SwiftEntryKit
instance.Eliminated static references between EKWindowProvider and lower level components, for consistent behaviour.
Testing Details 🔍
Create 2 SwiftEntryKit instances.
For example:
Call display on them at the same time (make sure the given EKAttributes have windowLevel property, toast is logical to have higher)
Observe the alert and toast showing up at the same time.
Screenshot Links 📷