Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Example with ability to edit waypoints #566

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

S2Ler
Copy link
Contributor

@S2Ler S2Ler commented Jul 22, 2021

  • Extends Example app with ability to edit waypoints and caches them to disk.
  • Moves Example app out of Carthage project.
  • Updates Example app with SPM based dependency management.
  • Adds localizedDescription to DirectionsError.swift. Without it, Xcode shows runtime issue saying that localizedDescription isn't available.
  • Works with Mac Catalyst.
  • A lot of room for further improvements :)

@S2Ler

This comment was marked as resolved.

@S2Ler S2Ler force-pushed the s2ler/extend-example branch 5 times, most recently from 567d6cd to b14c769 Compare April 1, 2022 11:06
@S2Ler S2Ler changed the title [DRAFT] Extend Example with ability to edit waypoints Extend Example with ability to edit waypoints Apr 1, 2022
@S2Ler S2Ler marked this pull request as ready for review April 1, 2022 11:16
@S2Ler S2Ler requested a review from a team April 1, 2022 11:16
@S2Ler S2Ler self-assigned this Apr 1, 2022
@S2Ler S2Ler requested review from a team, MaximAlien, kried and 1ec5 and removed request for a team January 6, 2023 07:21
@S2Ler
Copy link
Contributor Author

S2Ler commented Jan 6, 2023

Given that DirectionsPlayground(Former Example) app is separate project, we can bring back integration with Maps for better visualisation.

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2023

Codecov Report

Merging #566 (ed5e46e) into main (bb9fe98) will decrease coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #566      +/-   ##
==========================================
- Coverage   85.30%   85.22%   -0.08%     
==========================================
  Files          52       52              
  Lines        4545     4549       +4     
==========================================
  Hits         3877     3877              
- Misses        668      672       +4     
Impacted Files Coverage Δ
Sources/MapboxDirections/DirectionsError.swift 83.07% <0.00%> (-2.64%) ⬇️

.vscode/launch.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -110,7 +110,12 @@ public enum DirectionsError: LocalizedError {
*/

case unknown(response: URLResponse?, underlying: Error?, code: String?, message: String?)


public var errorDescription: String? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks like it shouldn't be in this pull request. It extends the public API of Directions and it is not used in the example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be separated, yes, but it is still used in the new code when presenting error alert: .alert(isPresented: .constant(error != nil), error: error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove this code, but I think it is a net win instead of something that is bad to have.


struct QueriesList: View {
@State
var queries: [Query] = [] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the first Query to the screen or should we add text explaining that you need to add a query to see how Directions work? It might be confusing to see the empty list

var urlString: String {
switch self {
case .waypointAllowsArrivingOnOppositeSide:
return "https://docs.mapbox.com/ios/directions/api/2.3.0/Classes/Waypoint.html#/s:16MapboxDirections8WaypointC28allowsArrivingOnOppositeSideSbvp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we would have to update the version here with each Directions SDK release.

Should we use 2.8.0 here for now?

import Combine
import MapboxDirections

struct QueryEditor: View {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a suggestion, names like these sound as if it was a model, not a view. Would it be possible to use names like QueryEditView?

@kried
Copy link
Contributor

kried commented Jan 9, 2023

It is a great idea to rewrite the example to use SPM and SwiftUI!

@S2Ler
Copy link
Contributor Author

S2Ler commented Jan 12, 2023

New example still not in a good shape. Editing query is buggy.

@S2Ler S2Ler marked this pull request as draft January 16, 2023 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants