Skip to content

Commit 53f4d3c

Browse files
authored
Merge pull request #479 from Esri/Caleb/Update-EditWithBranchVersioningVersionCreation
[Update] `Edit with branch versioning` version creation
2 parents c57504d + 0685413 commit 53f4d3c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Shared/Samples/Edit with branch versioning/EditWithBranchVersioningView.Model.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension EditWithBranchVersioningView {
3838
}()
3939

4040
/// A geodatabase connected to the damage assessment feature service.
41-
private let serviceGeodatabase = ServiceGeodatabase(url: .damageAssessmentFeatureService)
41+
let serviceGeodatabase = ServiceGeodatabase(url: .damageAssessmentFeatureService)
4242

4343
/// The feature layer for displaying the damaged building features.
4444
private(set) var featureLayer: FeatureLayer!

Shared/Samples/Edit with branch versioning/EditWithBranchVersioningView.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ struct EditWithBranchVersioningView: View {
2525
/// The parameters used to create a new version.
2626
@State private var versionParameters: ServiceVersionParameters?
2727

28-
/// The text representing the status of the sample.
29-
@State private var statusText = ""
30-
3128
/// The asynchronous action currently being preformed.
3229
@State private var selectedAction: AsyncAction? = .setUp
3330

@@ -102,17 +99,14 @@ struct EditWithBranchVersioningView: View {
10299
do {
103100
switch selectedAction {
104101
case .setUp:
105-
statusText = "Loading service geodatabase…"
106102
try await model.setUp()
107103

108104
guard let versionName = model.existingVersionNames.first else { break }
109-
statusText = "Version: \(versionName)"
110105
case .makeVersion:
111-
let name = try await model.createVersion(parameters: versionParameters!)
112-
statusText = "Created: \(name)"
106+
let version = try await model.createVersion(parameters: versionParameters!)
107+
try await model.switchToVersion(named: version)
113108
case .switchToVersion(let version):
114109
try await model.switchToVersion(named: version)
115-
statusText = "Version: \(version)"
116110
case .updateFeature:
117111
try await model.updateFeature()
118112
case .selectFeature(let screenPoint, let mapPoint):
@@ -139,7 +133,7 @@ struct EditWithBranchVersioningView: View {
139133
}
140134
}
141135
.overlay(alignment: .top) {
142-
Text(statusText)
136+
Text("Version: \(model.serviceGeodatabase.versionName)")
143137
.multilineTextAlignment(.center)
144138
.frame(maxWidth: .infinity, alignment: .center)
145139
.padding(8)

0 commit comments

Comments
 (0)