-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from hotwired/fix-refresh
Fix refresh behavior
- Loading branch information
Showing
4 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 18 additions & 4 deletions
22
Source/Turbo Navigator/TurboNavigationHierarchyControllerDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import SafariServices | ||
import WebKit | ||
|
||
/// Implement to be notified when certain navigations are performed | ||
/// or to render a native controller instead of a Turbo web visit. | ||
protocol TurboNavigationHierarchyControllerDelegate: AnyObject { | ||
func visit(_ : Visitable, on: TurboNavigationHierarchyController.NavigationStackType, with: VisitOptions) | ||
func refresh(navigationStack: TurboNavigationHierarchyController.NavigationStackType) | ||
|
||
/// Once the navigation hierarchy is modified, begin a visit on a navigation controller. | ||
/// | ||
/// - Parameters: | ||
/// - _: the Visitable destination | ||
/// - on: the navigation controller that was modified | ||
/// - with: the visit options | ||
func visit(_ : Visitable, | ||
on: TurboNavigationHierarchyController.NavigationStackType, | ||
with: VisitOptions) | ||
|
||
/// A refresh will pop (or dismiss) then ask the session to refresh the previous (or underlying) Visitable. | ||
/// | ||
/// - Parameters: | ||
/// - navigationStack: the stack where the refresh is happening | ||
/// - newTopmostVisitable: the visitable to be refreshed | ||
func refreshVisitable(navigationStack: TurboNavigationHierarchyController.NavigationStackType, | ||
newTopmostVisitable: Visitable) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters