Fix Route Guide tutorial compilation errors and implementation issues#32
Merged
Fix Route Guide tutorial compilation errors and implementation issues#32
Conversation
Remove .message accessor from request.latitude and request.longitude across unary, server streaming, and client streaming examples.
Motivation: The Notes class was referenced but not implemented in the Route Guide tutorial step 10. This adds the missing thread-safe Notes class that stores RouteNote messages. Modifications: - Added Notes class with Mutex for thread-safe storage of RouteNote messages - Added recordNote method to store notes and return notes from the same location - Added receivedNotes property to RouteGuideService Result: The Notes class is now properly implemented, allowing the routeChat method to store and retrieve notes in a thread-safe manner.
Step 7 was skipped in the original sequence. This fixes the step numbering to be sequential without gaps.
Client is generic and cannot be used directly in method signatures. Use ClientProtocol instead to fix compilation errors in tutorial examples.
glbrntt
requested changes
Nov 13, 2025
Collaborator
glbrntt
left a comment
There was a problem hiding this comment.
This is great, thank you. I left one comment which needs resolving in multiple places.
...ocumentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec06-step06-get-feature.swift
Outdated
Show resolved
Hide resolved
… of the existential ClientProtocol type.
glbrntt
requested changes
Nov 14, 2025
Collaborator
glbrntt
left a comment
There was a problem hiding this comment.
The formatter is unhappy now, running ./dev/format.sh should fix it
Contributor
Author
|
@glbrntt Thanks, the formatter is happy now!! |
glbrntt
approved these changes
Nov 17, 2025
Collaborator
glbrntt
left a comment
There was a problem hiding this comment.
Thank you for doing this!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Clienttype being used directly in method signatures, causing compilation errors.messageaccessorloadFeaturesbeing incorrectly defined as a private static method instead of an internal instance methodModifications:
ClienttoClientProtocolin method signatures across unary, server streaming, client streaming, and bidirectional streaming examples to fix generic type compilation issuesNotesclass withMutexfor storingRouteNotemessages, includingrecordNotemethod andreceivedNotesproperty inRouteGuideService.messageaccessor fromrequest.latitudeandrequest.longitudeacross all tutorial examples (unary, server streaming, client streaming)loadFeaturesfrom a static method to an instance method and changed its visibility from private to internal to make it accessible from extension filesResult:
The Route Guide tutorial now compiles successfully and provides complete, working examples for all four gRPC call types (unary, server streaming, client streaming, and bidirectional streaming).
Users can follow the tutorial from start to finish without encountering compilation errors or missing implementations.
A working sample implementation following this tutorial is available at https://github.com/mtfum/RouteGuide/.