Skip to content

Commit

Permalink
Merge pull request #8 from Miiha/fix/typo
Browse files Browse the repository at this point in the history
Fixes typo in DelegateAction
  • Loading branch information
Miiha authored Jan 19, 2023
2 parents 94b1a3b + 360fdd5 commit 4dce71b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Examples/Example/Example/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct App: ReducerProtocol {
case remoteCountResponse(TaskResult<Int>)
case requestAuthorizationResponse(TaskResult<Bool>)
case tappedScheduleButton
case userNotifications(UserNotificationClient.DeletegateAction)
case userNotifications(UserNotificationClient.DelegateAction)
}

@Dependency(\.remote) var remote
Expand Down
8 changes: 4 additions & 4 deletions Examples/Example/ExampleTests/ExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import XCTest
@MainActor
class ExampleTests: XCTestCase {
func testApplicationLaunchWithoutNotification() async throws {
let delegate = AsyncStream<UserNotificationClient.DeletegateAction>.streamWithContinuation()
let delegate = AsyncStream<UserNotificationClient.DelegateAction>.streamWithContinuation()
let requestedAuthorizationOptions = ActorIsolated<UNAuthorizationOptions?>(nil)
let store = TestStore(
initialState: App.State(count: nil),
Expand All @@ -27,7 +27,7 @@ class ExampleTests: XCTestCase {
}

func testApplicationLaunchWithtNotification() async throws {
let delegate = AsyncStream<UserNotificationClient.DeletegateAction>.streamWithContinuation()
let delegate = AsyncStream<UserNotificationClient.DelegateAction>.streamWithContinuation()
let requestedAuthorizationOptions = ActorIsolated<UNAuthorizationOptions?>(nil)

let store = TestStore(
Expand All @@ -51,7 +51,7 @@ class ExampleTests: XCTestCase {
}

func testNotificationPresentationHandling() async throws {
let delegate = AsyncStream<UserNotificationClient.DeletegateAction>.streamWithContinuation()
let delegate = AsyncStream<UserNotificationClient.DelegateAction>.streamWithContinuation()

let store = TestStore(
initialState: App.State(count: nil),
Expand Down Expand Up @@ -95,7 +95,7 @@ class ExampleTests: XCTestCase {
}

func testReceivedNotification() async throws {
let delegate = AsyncStream<UserNotificationClient.DeletegateAction>.streamWithContinuation()
let delegate = AsyncStream<UserNotificationClient.DelegateAction>.streamWithContinuation()

let store = TestStore(
initialState: App.State(count: nil),
Expand Down
8 changes: 4 additions & 4 deletions Sources/ComposableUserNotifications/Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct UserNotificationClient {
/// Actions that correspond to `UNUserNotificationCenterDelegate` methods.
///
/// See `UNUserNotificationCenterDelegate` for more information.
public enum DeletegateAction {
public enum DelegateAction {
case willPresentNotification(
_ notification: Notification,
completionHandler: (UNNotificationPresentationOptions) -> Void)
Expand Down Expand Up @@ -59,11 +59,11 @@ public struct UserNotificationClient {
/// This Effect represents calls to the `UNUserNotificationCenterDelegate`.
/// Handling the completion handlers of the `UNUserNotificationCenterDelegate`s methods
/// by multiple observers might lead to unexpected behaviour.
public var delegate: @Sendable () -> AsyncStream<DeletegateAction> = unimplemented("\(Self.self).delegate", placeholder: .finished)
public var delegate: @Sendable () -> AsyncStream<DelegateAction> = unimplemented("\(Self.self).delegate", placeholder: .finished)
}

extension UserNotificationClient.DeletegateAction: Equatable {
public static func == (lhs: UserNotificationClient.DeletegateAction, rhs: UserNotificationClient.DeletegateAction) -> Bool {
extension UserNotificationClient.DelegateAction: Equatable {
public static func == (lhs: UserNotificationClient.DelegateAction, rhs: UserNotificationClient.DelegateAction) -> Bool {
switch (lhs, rhs) {
case let (.willPresentNotification(lhs, _), .willPresentNotification(rhs, _)):
return lhs == rhs
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableUserNotifications/LiveKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ extension UserNotificationClient: DependencyKey {

private extension UserNotificationClient {
class Delegate: NSObject, UNUserNotificationCenterDelegate {
let continuation: AsyncStream<UserNotificationClient.DeletegateAction>.Continuation
let continuation: AsyncStream<UserNotificationClient.DelegateAction>.Continuation

init(continuation: AsyncStream<UserNotificationClient.DeletegateAction>.Continuation) {
init(continuation: AsyncStream<UserNotificationClient.DelegateAction>.Continuation) {
self.continuation = continuation
}

Expand Down

0 comments on commit 4dce71b

Please sign in to comment.