Skip to content

Commit

Permalink
Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
S2Ler committed Jan 12, 2023
1 parent 445f641 commit ed5e46e
Show file tree
Hide file tree
Showing 41 changed files with 138 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
E2E47CC227F62E06003C859F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2E47CC127F62E06003C859F /* Assets.xcassets */; };
E2E47CC527F62E06003C859F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2E47CC427F62E06003C859F /* Preview Assets.xcassets */; };
E2E47CE127F62E8F003C859F /* QueriesList.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDA27F62E8F003C859F /* QueriesList.swift */; };
E2E47CE227F62E8F003C859F /* DirectionsPlayground.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDB27F62E8F003C859F /* DirectionsPlayground.swift */; };
E2E47CE227F62E8F003C859F /* DirectionsExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDB27F62E8F003C859F /* DirectionsExample.swift */; };
E2E47CE327F62E8F003C859F /* RoutesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDC27F62E8F003C859F /* RoutesView.swift */; };
E2E47CE427F62E8F003C859F /* Query.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDD27F62E8F003C859F /* Query.swift */; };
E2E47CE527F62E8F003C859F /* QueryEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47CDE27F62E8F003C859F /* QueryEditor.swift */; };
Expand All @@ -21,18 +21,18 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
E2E47CBA27F62E05003C859F /* DirectionsPlayground.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DirectionsPlayground.app; sourceTree = BUILT_PRODUCTS_DIR; };
E2E47CBA27F62E05003C859F /* DirectionsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DirectionsExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
E2E47CC127F62E06003C859F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
E2E47CC427F62E06003C859F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
E2E47CDA27F62E8F003C859F /* QueriesList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueriesList.swift; sourceTree = "<group>"; };
E2E47CDB27F62E8F003C859F /* DirectionsPlayground.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DirectionsPlayground.swift; sourceTree = "<group>"; };
E2E47CDB27F62E8F003C859F /* DirectionsExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DirectionsExample.swift; sourceTree = "<group>"; };
E2E47CDC27F62E8F003C859F /* RoutesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoutesView.swift; sourceTree = "<group>"; };
E2E47CDD27F62E8F003C859F /* Query.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Query.swift; sourceTree = "<group>"; };
E2E47CDE27F62E8F003C859F /* QueryEditor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryEditor.swift; sourceTree = "<group>"; };
E2E47CDF27F62E8F003C859F /* WaypointsEditor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WaypointsEditor.swift; sourceTree = "<group>"; };
E2E47CE027F62E8F003C859F /* Storage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
E2E47CE827F62EAE003C859F /* mapbox-directions-swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "mapbox-directions-swift"; path = ..; sourceTree = "<group>"; };
E2E47CED27F630BE003C859F /* DirectionsPlayground.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DirectionsPlayground.entitlements; sourceTree = "<group>"; };
E2E47CED27F630BE003C859F /* DirectionsExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DirectionsExample.entitlements; sourceTree = "<group>"; };
E2E47CEE27F6EF7D003C859F /* InfoButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoButton.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -52,7 +52,7 @@
isa = PBXGroup;
children = (
E2E47CE827F62EAE003C859F /* mapbox-directions-swift */,
E2E47CBC27F62E05003C859F /* DirectionsPlayground */,
E2E47CBC27F62E05003C859F /* DirectionsExample */,
E2E47CBB27F62E05003C859F /* Products */,
E2E47CE927F62EB7003C859F /* Frameworks */,
);
Expand All @@ -61,20 +61,20 @@
E2E47CBB27F62E05003C859F /* Products */ = {
isa = PBXGroup;
children = (
E2E47CBA27F62E05003C859F /* DirectionsPlayground.app */,
E2E47CBA27F62E05003C859F /* DirectionsExample.app */,
);
name = Products;
sourceTree = "<group>";
};
E2E47CBC27F62E05003C859F /* DirectionsPlayground */ = {
E2E47CBC27F62E05003C859F /* DirectionsExample */ = {
isa = PBXGroup;
children = (
E2E47CED27F630BE003C859F /* DirectionsPlayground.entitlements */,
E2E47CED27F630BE003C859F /* DirectionsExample.entitlements */,
E2E47CD927F62E78003C859F /* Sources */,
E2E47CC127F62E06003C859F /* Assets.xcassets */,
E2E47CC327F62E06003C859F /* Preview Content */,
);
path = DirectionsPlayground;
path = DirectionsExample;
sourceTree = "<group>";
};
E2E47CC327F62E06003C859F /* Preview Content */ = {
Expand All @@ -88,7 +88,7 @@
E2E47CD927F62E78003C859F /* Sources */ = {
isa = PBXGroup;
children = (
E2E47CDB27F62E8F003C859F /* DirectionsPlayground.swift */,
E2E47CDB27F62E8F003C859F /* DirectionsExample.swift */,
E2E47CDA27F62E8F003C859F /* QueriesList.swift */,
E2E47CDD27F62E8F003C859F /* Query.swift */,
E2E47CDE27F62E8F003C859F /* QueryEditor.swift */,
Expand All @@ -110,9 +110,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
E2E47CB927F62E05003C859F /* DirectionsPlayground */ = {
E2E47CB927F62E05003C859F /* DirectionsExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = E2E47CC827F62E06003C859F /* Build configuration list for PBXNativeTarget "DirectionsPlayground" */;
buildConfigurationList = E2E47CC827F62E06003C859F /* Build configuration list for PBXNativeTarget "DirectionsExample" */;
buildPhases = (
E2E47CB627F62E05003C859F /* Sources */,
E2E47CB727F62E05003C859F /* Frameworks */,
Expand All @@ -123,12 +123,12 @@
);
dependencies = (
);
name = DirectionsPlayground;
name = DirectionsExample;
packageProductDependencies = (
E2E47CEA27F62EB7003C859F /* MapboxDirections */,
);
productName = DirectionsPlayground;
productReference = E2E47CBA27F62E05003C859F /* DirectionsPlayground.app */;
productReference = E2E47CBA27F62E05003C859F /* DirectionsExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand All @@ -147,7 +147,7 @@
};
};
};
buildConfigurationList = E2E47CB527F62E05003C859F /* Build configuration list for PBXProject "DirectionsPlayground" */;
buildConfigurationList = E2E47CB527F62E05003C859F /* Build configuration list for PBXProject "DirectionsExample" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -160,7 +160,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
E2E47CB927F62E05003C859F /* DirectionsPlayground */,
E2E47CB927F62E05003C859F /* DirectionsExample */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -208,7 +208,7 @@
E2E47CE727F62E8F003C859F /* Storage.swift in Sources */,
E2E47CE427F62E8F003C859F /* Query.swift in Sources */,
E2E47CEF27F6EF7D003C859F /* InfoButton.swift in Sources */,
E2E47CE227F62E8F003C859F /* DirectionsPlayground.swift in Sources */,
E2E47CE227F62E8F003C859F /* DirectionsExample.swift in Sources */,
E2E47CE327F62E8F003C859F /* RoutesView.swift in Sources */,
E2E47CE127F62E8F003C859F /* QueriesList.swift in Sources */,
E2E47CE627F62E8F003C859F /* WaypointsEditor.swift in Sources */,
Expand Down Expand Up @@ -338,10 +338,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = DirectionsPlayground/DirectionsPlayground.entitlements;
CODE_SIGN_ENTITLEMENTS = DirectionsExample/DirectionsExample.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"DirectionsPlayground/Preview Content\"";
DEVELOPMENT_ASSET_PATHS = "\"DirectionsExample/Preview Content\"";
DEVELOPMENT_TEAM = GJZR2MEM28;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -356,7 +356,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = mapbox.DirectionsPlayground;
PRODUCT_BUNDLE_IDENTIFIER = mapbox.DirectionsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -372,10 +372,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = DirectionsPlayground/DirectionsPlayground.entitlements;
CODE_SIGN_ENTITLEMENTS = DirectionsExample/DirectionsExample.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"DirectionsPlayground/Preview Content\"";
DEVELOPMENT_ASSET_PATHS = "\"DirectionsExample/Preview Content\"";
DEVELOPMENT_TEAM = GJZR2MEM28;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -390,7 +390,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = mapbox.DirectionsPlayground;
PRODUCT_BUNDLE_IDENTIFIER = mapbox.DirectionsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -402,7 +402,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
E2E47CB527F62E05003C859F /* Build configuration list for PBXProject "DirectionsPlayground" */ = {
E2E47CB527F62E05003C859F /* Build configuration list for PBXProject "DirectionsExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E2E47CC627F62E06003C859F /* Debug */,
Expand All @@ -411,7 +411,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E2E47CC827F62E06003C859F /* Build configuration list for PBXNativeTarget "DirectionsPlayground" */ = {
E2E47CC827F62E06003C859F /* Build configuration list for PBXNativeTarget "DirectionsExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E2E47CC927F62E06003C859F /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2E47CB927F62E05003C859F"
BuildableName = "DirectionsExample.app"
BlueprintName = "DirectionsExample"
ReferencedContainer = "container:DirectionsExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2E47CB927F62E05003C859F"
BuildableName = "DirectionsExample.app"
BlueprintName = "DirectionsExample"
ReferencedContainer = "container:DirectionsExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2E47CB927F62E05003C859F"
BuildableName = "DirectionsExample.app"
BlueprintName = "DirectionsExample"
ReferencedContainer = "container:DirectionsExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI

@main
struct DirectionsPlayground: App {
struct DirectionsExample: App {
var body: some Scene {
WindowGroup {
NavigationView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,32 @@ struct QueriesList: View {
NavigationLink(
destination: QueryEditor(query: $query),
label: {
Text(query.name)
TextField("Query Name", text: $query.name)
})
}
.onMove { indices, newOffset in
queries.move(fromOffsets: indices, toOffset: newOffset)
}
.onDelete { indexSet in
queries.remove(atOffsets: indexSet)
}
}
.onAppear { loadQueries() }
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button { newQuery() }
label: { Image(systemName: "plus") }
}
ToolbarItem(placement: ToolbarItemPlacement.automatic) {
EditButton()
}
}
.navigationTitle("Saved Queries")
}

private func loadQueries() {
do {
queries = try Storage.shared.load() ?? []
queries = try Storage.shared.load() ?? [.default]
}
catch {
print(error)
Expand Down
16 changes: 16 additions & 0 deletions DirectionsExample/DirectionsExample/Sources/Query.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Foundation

struct Query: Codable, Identifiable {
let id: String
var name: String
var waypoints: [Waypoint]

static func make() -> Query {
let uuid = UUID().uuidString
return .init(id: uuid, name: "New Query", waypoints: .defaultWaypoints)
}

static var `default`: Query {
.init(id: UUID().uuidString, name: "Mapbox Office", waypoints: .defaultWaypoints)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ struct QueryEditor: View {
destination: RoutesView(routes: routes),
isActive: $showRoutes,
label: {
Button("Calculate") {
Button("Directions") {
loadRoutes(for: query)
}.buttonStyle(.borderless)
})
}
})
.navigationTitle("Edit Route Waypoints")
.navigationTitle(query.name)

}
.alert(isPresented: .constant(error != nil), error: error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct WaypointView: View {

init(waypoint: Binding<Waypoint>) {
_waypoint = waypoint
_latitudeString = State<String>(initialValue: waypoint.wrappedValue.latitude.description)
_latitudeString = .init(initialValue: waypoint.wrappedValue.latitude.description)
_longitudeString = .init(initialValue: waypoint.wrappedValue.longitude.description)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Directions Playground
# Directions Example

Shows how to obtain directions using "MapboxDirection" library.

## Requirements
## Requirements

- Xcode 13.3
- Xcode 13.3
- iOS 15
12 changes: 0 additions & 12 deletions DirectionsPlayground/DirectionsPlayground/Sources/Query.swift

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Or in your [Swift Package Manager](https://swift.org/package-manager/) Package.s

Then `import MapboxDirections`.

This repository contains an [example application](./DirectionsPlayground/) that demonstrates how to use the framework. Detailed documentation is available in the [Mapbox API Documentation](https://docs.mapbox.com/api/navigation/#directions).
This repository contains an [example application](./DirectionsExample/) that demonstrates how to use the framework. Detailed documentation is available in the [Mapbox API Documentation](https://docs.mapbox.com/api/navigation/#directions).

## System requirements

Expand Down

0 comments on commit ed5e46e

Please sign in to comment.