From f4dc72b61fb789dc0e96068717f7a2e52c60244e Mon Sep 17 00:00:00 2001 From: Nikita Semenov Date: Tue, 4 Oct 2022 12:08:38 +0300 Subject: [PATCH] refactor: typos --- TILogging/Sources/LoggingPresenter.swift | 4 ++-- .../Views/LoggerWindow/LoggingTogglingViewController.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TILogging/Sources/LoggingPresenter.swift b/TILogging/Sources/LoggingPresenter.swift index 7f79b101..11f85377 100644 --- a/TILogging/Sources/LoggingPresenter.swift +++ b/TILogging/Sources/LoggingPresenter.swift @@ -41,7 +41,7 @@ final public class LoggingPresenter { private init() { } - /// binds openning and closing of logging list view to a shacking motion. + /// binds openning and closing of logging list view to a shaking motion. public func bind(_ scene: UIWindowScene? = nil) { if let scene = scene { window.windowScene = scene @@ -51,7 +51,7 @@ final public class LoggingPresenter { loggingViewController.setVisible(isVisible: false) } - /// unbinds openning and closing of logging list view by shacking motion. + /// unbinds openning and closing of logging list view by shaking motion. public func unbind() { window.isHidden = true loggingViewController.setVisible(isVisible: true) diff --git a/TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift b/TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift index 7a68aad0..c7f4e42f 100644 --- a/TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift +++ b/TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift @@ -28,7 +28,7 @@ open class LoggingTogglingViewController: BaseInitializeableViewController { private var initialCenter = CGPoint() - private var isRegisteredForShackingEvent: Bool { + private var isRegisteredForShakingEvent: Bool { !isVisibleState } @@ -68,7 +68,7 @@ open class LoggingTogglingViewController: BaseInitializeableViewController { button.addGestureRecognizer(panGesture) button.addTarget(self, action: #selector(openLoggingScreenAction), for: .touchUpInside) - // Needed for catching shacking motion + // Needed for catching shaking motion becomeFirstResponder() } @@ -88,7 +88,7 @@ open class LoggingTogglingViewController: BaseInitializeableViewController { // MARK: - Overrided methods open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { - if !isLogsPresented, isRegisteredForShackingEvent { + if motion == .motionShake, !isLogsPresented, isRegisteredForShakingEvent { openLoggingScreen() } }