Repository navigation
Move text instruction creation to core - #385
Conversation
| s.dependency "MapboxCoreNavigation", "#{s.version.to_s}" | ||
| s.dependency "MapboxDirections.swift", "~> 0.10.0" | ||
| s.dependency "Mapbox-iOS-SDK", "~> 3.5" | ||
| s.dependency "OSRMTextInstructions", "~> 0.2.0" |
There was a problem hiding this comment.
Pretty certain since these are in core, we don't need to import these packages.
| 35C6EDB21EBB286500A27EF8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; }; | ||
| 35C9973E1E732C1B00544D1C /* RouteVoiceController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RouteVoiceController.swift; sourceTree = "<group>"; }; | ||
| 35C997401E732C5400544D1C /* RouteStepFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RouteStepFormatter.swift; sourceTree = "<group>"; }; | ||
| 35C9973E1E732C1B00544D1C /* RouteVoiceController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RouteVoiceController.swift; path = ../MapboxNavigation/RouteVoiceController.swift; sourceTree = "<group>"; }; |
There was a problem hiding this comment.
Move RouteVoiceController.swift to the MapboxCoreNavigation folder.
| s.dependency "MapboxCoreNavigation", "#{s.version.to_s}" | ||
| s.dependency "MapboxDirections.swift", "~> 0.10.0" | ||
| s.dependency "Mapbox-iOS-SDK", "~> 3.5" | ||
| s.dependency "OSRMTextInstructions", "~> 0.2.0" |
There was a problem hiding this comment.
Make this change to MapboxNavigation-Documentation.podspec as well.
There was a problem hiding this comment.
It doesn't look like we require MapboxCoreNavigation in this podspec though. I think we can add it as a dep or leave as is.
There was a problem hiding this comment.
Ah, I see, that’s because MapboxNavigation-Documentation.podspec produces a single combined framework.
|
|
||
| override func speak(_ text: String, error: String?) { | ||
| assert(!text.isEmpty) | ||
| override public func speak(instruction: String, error: String?) { |
There was a problem hiding this comment.
It’s fine to use _ instruction here, because instruction is precisely what’s being spoken.
| } | ||
|
|
||
| guard let userDistance = notification.userInfo![RouteControllerAlertLevelDidChangeNotificationDistanceToEndOfManeuverKey] as? CLLocationDistance else { | ||
| assert(false) |
There was a problem hiding this comment.
Instead of guarding, only to fail hard if the condition evaluates to false, it would be clearer to force-unwrap the userInfo entry using as!.
| /** | ||
| Creates an audio instruction from a `RouteProgress`, the users distance from the maneuver. Optional `markUpWithSSML` will apply `SSML` to the string. This is useful when using AWS's Polly speech synthesizer. | ||
| */ | ||
| public func createSpeakText(from routeProgress: RouteProgress, at userDistance: CLLocationDistance, markUpWithSSML: Bool = false) -> String { |
There was a problem hiding this comment.
createSpeakText is ungrammatical; a better method name would be speechString(describing:at:markUpWithSSML:).
|
This is ready. |
This reverts commit f72996b.
This reverts commit f72996b.
Keep access token out this repository
Closes: #367
Moves text instruction creation to core and makes the functions
createSpeakTextandspeakpublic./cc @frederoni @1ec5 @ericrwolfe