Room user indicators

Signed-off-by: Andy Uhnak <andyuhnak@gmail.com>
This commit is contained in:
Andy Uhnak
2022-02-23 09:47:35 +00:00
parent 2bec561b1f
commit 3f82e61723
28 changed files with 458 additions and 329 deletions
@@ -16,7 +16,7 @@
import Foundation
class UserIndicatorPresenterSpy: UserIndicatorPresentable {
class UserIndicatorPresenterSpy: UserIndicatorViewPresentable {
var intel = [String]()
func present() {
@@ -17,9 +17,10 @@
import Foundation
/// A presenter associated with and called by a `UserIndicator`, and responsible for the underlying view shown on the screen.
public protocol UserIndicatorPresentable {
public protocol UserIndicatorViewPresentable {
/// Called when the `UserIndicator` is started (manually or by the `UserIndicatorQueue`)
func present()
/// Called when the `UserIndicator` is manually cancelled or completed
func dismiss()
}
@@ -28,8 +28,11 @@ public class UserIndicatorQueue {
}
}
public static let shared = UserIndicatorQueue()
private var queue = [Weak<UserIndicator>]()
private var queue: [Weak<UserIndicator>]
public init() {
queue = []
}
/// Add a new indicator to the queue by providing a request.
///
@@ -18,10 +18,10 @@ import Foundation
/// A request used to create an underlying `UserIndicator`, allowing clients to only specify the visual aspects of an indicator.
public struct UserIndicatorRequest {
internal let presenter: UserIndicatorPresentable
internal let presenter: UserIndicatorViewPresentable
internal let dismissal: UserIndicatorDismissal
public init(presenter: UserIndicatorPresentable, dismissal: UserIndicatorDismissal) {
public init(presenter: UserIndicatorViewPresentable, dismissal: UserIndicatorDismissal) {
self.presenter = presenter
self.dismissal = dismissal
}