Skip to content

Commit

Permalink
Rename functions to better match behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Dec 12, 2023
1 parent bf8049f commit 12c6661
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Source/Turbo Navigator/TurboNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -116,7 +116,7 @@ extension TurboNavigator: SessionDelegate {
self.session.clearSnapshotCache()
}
if let url = session.topmostVisitable?.visitableURL {
delegate.didSubmitForm(at: url)
delegate.formSubmissionDidFinish(at: url)
}
}

Expand Down
12 changes: 6 additions & 6 deletions Source/Turbo Navigator/TurboNavigatorDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {}
}

0 comments on commit 12c6661

Please sign in to comment.