huri000 / SwiftEntryKit

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
MIT License
6.63k stars 608 forks source link

Support for multiple SwiftEntryKit instances working in parallel #366

Open ZsoltMolnarMBH opened 2 years ago

ZsoltMolnarMBH commented 2 years ago

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:

extension SwiftEntryKit {
    static let toast = SwiftEntryKit()
    static let alert = SwiftEntryKit()
}

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 📷

Simulator Screen Recording - iPhone 12 - 2022-03-23 at 18 31 31

ZsoltMolnarrr commented 2 years ago

@AXGithub

must Support for multiple SwiftEntryKit instances working in parallel

The current state of the PR does support multiple SwiftEntryKit instances working in parallel. This is actually visible on the attached gif, where one instance is showing an ActionSheet and one showing a Toast.

Could you please specify the changes you would require?

AXGithub commented 2 years ago

@AXGithub

must Support for multiple SwiftEntryKit instances working in parallel

The current state of the PR does support multiple SwiftEntryKit instances working in parallel. This is actually visible on the attached gif, where one instance is showing an ActionSheet and one showing a Toast.

Could you please specify the changes you would require?

image

version: 2.0.0

ZsoltMolnarMBH commented 2 years ago

@AXGithub

must Support for multiple SwiftEntryKit instances working in parallel

The current state of the PR does support multiple SwiftEntryKit instances working in parallel. This is actually visible on the attached gif, where one instance is showing an ActionSheet and one showing a Toast. Could you please specify the changes you would require?

image

version: 2.0.0

Please reply in full english sentences specifying the actual change you require. Also would you mind sharing why you are specifically perform this review process?

petsound commented 1 year ago

It would be great if this could be merged into SwiftEntryKit. I have seen no issues using this code and it has been very useful. Though going by the lack of activity to SwiftEntryKit, it seems as though this project may be abandoned (which would be a shame).