From d64f37008028914c6223905eb332f7185d60e5d3 Mon Sep 17 00:00:00 2001 From: Zhizhen He Date: Fri, 29 Mar 2024 01:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop/Extensions/Notification+Extensions.swift | 2 +- Loop/Extensions/View+Extensions.swift | 2 +- Loop/Managers/LoopManager.swift | 4 ++-- Loop/Preview Window/PreviewController.swift | 4 ++-- Loop/Radial Menu/RadialMenuView.swift | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Loop/Extensions/Notification+Extensions.swift b/Loop/Extensions/Notification+Extensions.swift index f0dbfac3..2f9c7a0f 100644 --- a/Loop/Extensions/Notification+Extensions.swift +++ b/Loop/Extensions/Notification+Extensions.swift @@ -15,7 +15,7 @@ extension Notification.Name { static let didLoop = Notification.Name("didLoop") @discardableResult - func onRecieve(object: Any? = nil, using: @escaping (Notification) -> Void) -> NSObjectProtocol { + func onReceive(object: Any? = nil, using: @escaping (Notification) -> Void) -> NSObjectProtocol { return NotificationCenter.default.addObserver( forName: self, object: object, diff --git a/Loop/Extensions/View+Extensions.swift b/Loop/Extensions/View+Extensions.swift index d76b78e9..0fb91ce3 100644 --- a/Loop/Extensions/View+Extensions.swift +++ b/Loop/Extensions/View+Extensions.swift @@ -8,7 +8,7 @@ import SwiftUI extension View { - // Make it easier to recieve notifications SwiftUI views + // Make it easier to receive notifications SwiftUI views func onReceive( _ name: Notification.Name, center: NotificationCenter = .default, diff --git a/Loop/Managers/LoopManager.swift b/Loop/Managers/LoopManager.swift index 89dc7e28..864e7ac1 100644 --- a/Loop/Managers/LoopManager.swift +++ b/Loop/Managers/LoopManager.swift @@ -71,11 +71,11 @@ class LoopManager: ObservableObject { } } - Notification.Name.forceCloseLoop.onRecieve { _ in + Notification.Name.forceCloseLoop.onReceive { _ in self.closeLoop(forceClose: true) } - Notification.Name.updateBackendDirection.onRecieve { notification in + Notification.Name.updateBackendDirection.onReceive { notification in if let action = notification.userInfo?["action"] as? WindowAction { self.changeAction(action) } diff --git a/Loop/Preview Window/PreviewController.swift b/Loop/Preview Window/PreviewController.swift index 1171641b..1238602b 100644 --- a/Loop/Preview Window/PreviewController.swift +++ b/Loop/Preview Window/PreviewController.swift @@ -15,7 +15,7 @@ class PreviewController { private var window: Window? init() { - Notification.Name.updateUIDirection.onRecieve { obj in + Notification.Name.updateUIDirection.onReceive { obj in if let action = obj.userInfo?["action"] as? WindowAction { self.setAction(to: action) } @@ -105,6 +105,6 @@ class PreviewController { windowController.window?.animator().alphaValue = shouldBeTransparent ? 0 : 1 } - print("New preview window action recieved: \(action.direction)") + print("New preview window action received: \(action.direction)") } } diff --git a/Loop/Radial Menu/RadialMenuView.swift b/Loop/Radial Menu/RadialMenuView.swift index 9d3fbf40..096a8726 100644 --- a/Loop/Radial Menu/RadialMenuView.swift +++ b/Loop/Radial Menu/RadialMenuView.swift @@ -115,8 +115,8 @@ struct RadialMenuView: View { if !self.previewMode, let action = obj.userInfo?["action"] as? WindowAction { self.currentAction = .init(action.direction.base) - print("New radial menu window action recieved: \(action.direction)") + print("New radial menu window action received: \(action.direction)") } } } -} +}