From 12c6661dc42c16a87cad78435f168ce1bad29a7a Mon Sep 17 00:00:00 2001 From: Joe Masilotti Date: Tue, 12 Dec 2023 09:52:00 -0800 Subject: [PATCH] Rename functions to better match behavior --- Source/Turbo Navigator/TurboNavigator.swift | 4 ++-- Source/Turbo Navigator/TurboNavigatorDelegate.swift | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Turbo Navigator/TurboNavigator.swift b/Source/Turbo Navigator/TurboNavigator.swift index 49bb1fa..7dfde45 100644 --- a/Source/Turbo Navigator/TurboNavigator.swift +++ b/Source/Turbo Navigator/TurboNavigator.swift @@ -107,7 +107,7 @@ extension TurboNavigator: SessionDelegate { public func sessionDidStartFormSubmission(_ session: Session) { if let url = session.topmostVisitable?.visitableURL { - delegate.willSubmitForm(to: url) + delegate.formSubmissionDidStart(to: url) } } @@ -116,7 +116,7 @@ extension TurboNavigator: SessionDelegate { self.session.clearSnapshotCache() } if let url = session.topmostVisitable?.visitableURL { - delegate.didSubmitForm(at: url) + delegate.formSubmissionDidFinish(at: url) } } diff --git a/Source/Turbo Navigator/TurboNavigatorDelegate.swift b/Source/Turbo Navigator/TurboNavigatorDelegate.swift index 259e0aa..6075986 100644 --- a/Source/Turbo Navigator/TurboNavigatorDelegate.swift +++ b/Source/Turbo Navigator/TurboNavigatorDelegate.swift @@ -21,13 +21,13 @@ public protocol TurboNavigatorDelegate: AnyObject { /// If not implemented, default handling will be performed. func didReceiveAuthenticationChallenge(_ challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - /// Optional. Called before a form is submitted. + /// Optional. Called after a form starts a submission. /// If not implemented, no action is taken. - func willSubmitForm(to url: URL) + func formSubmissionDidStart(to url: URL) - /// Optional. Called when a form is submitted. + /// Optional. Called after a form finishes a submission. /// If not implemented, no action is taken. - func didSubmitForm(at url: URL) + func formSubmissionDidFinish(at url: URL) } public extension TurboNavigatorDelegate { @@ -45,7 +45,7 @@ public extension TurboNavigatorDelegate { completionHandler(.performDefaultHandling, nil) } - func willSubmitForm(to url: URL) {} + func formSubmissionDidStart(to url: URL) {} - func didSubmitForm(at url: URL) {} + func formSubmissionDidFinish(at url: URL) {} }