From 998da7e94c439070b4c5dec8d523cf26b9fd8b97 Mon Sep 17 00:00:00 2001 From: Fred Bergman Date: Thu, 3 Mar 2022 21:11:08 +0100 Subject: [PATCH] Fix typo in migration guide --- Docs/Migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Migration.md b/Docs/Migration.md index 0b5c1cf..7675172 100644 --- a/Docs/Migration.md +++ b/Docs/Migration.md @@ -7,7 +7,7 @@ Follow these steps, and you should be up and running in no time. I was able to u 1. Update your dependency manager to point to `hotwired/turbo-ios` instead `turbolinks/turbolinks-ios`, see the [installation](Installation.md) doc for more info. 2. Change all your imports from `import Turbolinks` to `import Turbo`. This also would apply if you have any place you're using the full module for a type, like `Turbolinks.Session` would need to change to `Turbo.Session` 3. Try to build, at which point you should start to see a few errors for API changes. -4. `session(_ session: Session, didPropseVisitToURL url: URL, withAction action: Action)` is now `session(_ session: Session, didProposeVisit proposal: VisitProposal)`. The new `VisitProposal` type includes the url and a new `VisitOptions` type. The `VisitOptions` type includes the action. +4. `session(_ session: Session, didProposeVisitToURL url: URL, withAction action: Action)` is now `session(_ session: Session, didProposeVisit proposal: VisitProposal)`. The new `VisitProposal` type includes the url and a new `VisitOptions` type. The `VisitOptions` type includes the action. 5. `func session(_ session: Session, didFailRequestForVisitable visitable: Visitable, withError error: NSError)` is now `func session(_ session: Session, didFailRequestForVisitable visitable: Visitable, error: Error)`. What was previously an `NSError` is now an `Error`. To access the statusCode from a failure, you can check if the error is a new `TurboError` type like so: `let turboError = error as? TurboError, case .http(let statusCode) = turboError` 6. That should be the major code changes, please test your app first and open an issue if you run into blockers during migration. Note: the old Turbolinks.framework is now deprecated, but you can continue to use it as long as it works for you.