Skip to content

Commit 27259c3

Browse files
authored
Merge pull request #828 from Esri/v.next
Merge `v.next` into `main`
2 parents 79f67ba + 98fec29 commit 27259c3

File tree

305 files changed

+11801
-2862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+11801
-2862
lines changed

.swiftlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ opt_in_rules:
6464
- redundant_nil_coalescing
6565
- redundant_type_annotation
6666
- sorted_first_last
67+
- sorted_imports
6768
- static_operator
6869
- toggle_bool
6970
- trailing_closure

.swiftpm/xcode/xcshareddata/xcschemes/arcgis-runtime-toolkit-swift.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1250"
3+
LastUpgradeVersion = "1530"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

AuthenticationExample/AuthenticationExample.xcodeproj/project.pbxproj

+34-5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
88AD13712834355000500B2E /* Sources */,
112112
88AD13722834355000500B2E /* Frameworks */,
113113
88AD13732834355000500B2E /* Resources */,
114+
8AA526702BCF1887007D28B1 /* Lint Sources */,
114115
);
115116
buildRules = (
116117
);
@@ -132,7 +133,7 @@
132133
attributes = {
133134
BuildIndependentTargetsInParallel = 1;
134135
LastSwiftUpdateCheck = 1320;
135-
LastUpgradeCheck = 1320;
136+
LastUpgradeCheck = 1530;
136137
TargetAttributes = {
137138
88AD13742834355000500B2E = {
138139
CreatedOnToolsVersion = 13.2.1;
@@ -169,6 +170,28 @@
169170
};
170171
/* End PBXResourcesBuildPhase section */
171172

173+
/* Begin PBXShellScriptBuildPhase section */
174+
8AA526702BCF1887007D28B1 /* Lint Sources */ = {
175+
isa = PBXShellScriptBuildPhase;
176+
alwaysOutOfDate = 1;
177+
buildActionMask = 2147483647;
178+
files = (
179+
);
180+
inputFileListPaths = (
181+
);
182+
inputPaths = (
183+
);
184+
name = "Lint Sources";
185+
outputFileListPaths = (
186+
);
187+
outputPaths = (
188+
);
189+
runOnlyForDeploymentPostprocessing = 0;
190+
shellPath = /bin/sh;
191+
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint --config ../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
192+
};
193+
/* End PBXShellScriptBuildPhase section */
194+
172195
/* Begin PBXSourcesBuildPhase section */
173196
88AD13712834355000500B2E /* Sources */ = {
174197
isa = PBXSourcesBuildPhase;
@@ -225,6 +248,7 @@
225248
DEBUG_INFORMATION_FORMAT = dwarf;
226249
ENABLE_STRICT_OBJC_MSGSEND = YES;
227250
ENABLE_TESTABILITY = YES;
251+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
228252
GCC_C_LANGUAGE_STANDARD = gnu11;
229253
GCC_DYNAMIC_NO_PIC = NO;
230254
GCC_NO_COMMON_BLOCKS = YES;
@@ -239,7 +263,7 @@
239263
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
240264
GCC_WARN_UNUSED_FUNCTION = YES;
241265
GCC_WARN_UNUSED_VARIABLE = YES;
242-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
266+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
243267
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
244268
MTL_FAST_MATH = YES;
245269
ONLY_ACTIVE_ARCH = YES;
@@ -286,6 +310,7 @@
286310
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
287311
ENABLE_NS_ASSERTIONS = NO;
288312
ENABLE_STRICT_OBJC_MSGSEND = YES;
313+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
289314
GCC_C_LANGUAGE_STANDARD = gnu11;
290315
GCC_NO_COMMON_BLOCKS = YES;
291316
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -294,7 +319,7 @@
294319
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
295320
GCC_WARN_UNUSED_FUNCTION = YES;
296321
GCC_WARN_UNUSED_VARIABLE = YES;
297-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
322+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
298323
MTL_ENABLE_DEBUG_INFO = NO;
299324
MTL_FAST_MATH = YES;
300325
SDKROOT = iphoneos;
@@ -314,6 +339,7 @@
314339
CURRENT_PROJECT_VERSION = 1;
315340
DEVELOPMENT_ASSET_PATHS = "\"AuthenticationExample/Preview Content\"";
316341
ENABLE_PREVIEWS = YES;
342+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
317343
GENERATE_INFOPLIST_FILE = YES;
318344
INFOPLIST_FILE = AuthenticationExample/Info.plist;
319345
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@@ -325,13 +351,14 @@
325351
"$(inherited)",
326352
"@executable_path/Frameworks",
327353
);
328-
MARKETING_VERSION = 200.4.0;
354+
MARKETING_VERSION = 200.5.0;
329355
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
330356
PRODUCT_NAME = "$(TARGET_NAME)";
331357
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
332358
SUPPORTS_MACCATALYST = YES;
333359
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
334360
SWIFT_EMIT_LOC_STRINGS = YES;
361+
SWIFT_STRICT_CONCURRENCY = complete;
335362
SWIFT_VERSION = 5.0;
336363
TARGETED_DEVICE_FAMILY = "1,2";
337364
};
@@ -347,6 +374,7 @@
347374
CURRENT_PROJECT_VERSION = 1;
348375
DEVELOPMENT_ASSET_PATHS = "\"AuthenticationExample/Preview Content\"";
349376
ENABLE_PREVIEWS = YES;
377+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
350378
GENERATE_INFOPLIST_FILE = YES;
351379
INFOPLIST_FILE = AuthenticationExample/Info.plist;
352380
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@@ -358,13 +386,14 @@
358386
"$(inherited)",
359387
"@executable_path/Frameworks",
360388
);
361-
MARKETING_VERSION = 200.4.0;
389+
MARKETING_VERSION = 200.5.0;
362390
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
363391
PRODUCT_NAME = "$(TARGET_NAME)";
364392
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
365393
SUPPORTS_MACCATALYST = YES;
366394
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
367395
SWIFT_EMIT_LOC_STRINGS = YES;
396+
SWIFT_STRICT_CONCURRENCY = complete;
368397
SWIFT_VERSION = 5.0;
369398
TARGETED_DEVICE_FAMILY = "1,2";
370399
};

AuthenticationExample/AuthenticationExample/AuthenticationApp.swift

+11-18
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,18 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
16-
import ArcGISToolkit
1715
import ArcGIS
16+
import ArcGISToolkit
17+
import SwiftUI
1818

1919
@main
2020
struct AuthenticationApp: App {
21-
@ObservedObject var authenticator: Authenticator
22-
@State var isSettingUp = true
21+
@StateObject private var authenticator = Authenticator(
22+
// If you want to use OAuth, uncomment this code:
23+
// oAuthUserConfigurations: [.arcgisDotCom]
24+
)
2325

24-
init() {
25-
// Create an authenticator.
26-
authenticator = Authenticator(
27-
// If you want to use OAuth, uncomment this code:
28-
//oAuthUserConfigurations: [.arcgisDotCom]
29-
)
30-
// Sets authenticator as ArcGIS and Network challenge handlers to handle authentication
31-
// challenges.
32-
ArcGISEnvironment.authenticationManager.handleChallenges(using: authenticator)
33-
}
26+
@State private var isSettingUp = true
3427

3528
var body: some SwiftUI.Scene {
3629
WindowGroup {
@@ -48,9 +41,9 @@ struct AuthenticationApp: App {
4841
// - Integrated Windows Authentication (IWA)
4942
// - Client Certificate (PKI)
5043
.authenticator(authenticator)
51-
.environmentObject(authenticator)
5244
.task {
5345
isSettingUp = true
46+
ArcGISEnvironment.authenticationManager.handleChallenges(using: authenticator)
5447
// Here we setup credential stores to be persistent, which means that it will
5548
// synchronize with the keychain for storing credentials.
5649
// It also means that a user can sign in without having to be prompted for
@@ -63,8 +56,8 @@ struct AuthenticationApp: App {
6356
}
6457
}
6558

66-
// If you want to use OAuth, you can uncomment this code:
67-
//private extension OAuthUserConfiguration {
59+
private extension OAuthUserConfiguration {
60+
// If you want to use OAuth, uncomment this code:
6861
// static let arcgisDotCom = OAuthUserConfiguration(
6962
// portalURL: .portal,
7063
// clientID: "<#Your client ID goes here#>",
@@ -73,7 +66,7 @@ struct AuthenticationApp: App {
7366
// // The scheme of the redirect URL is also specified in the Info.plist file.
7467
// redirectURL: URL(string: "authexample://auth")!
7568
// )
76-
//}
69+
}
7770

7871
extension URL {
7972
// If you want to use your own portal, provide your own URL here:

AuthenticationExample/AuthenticationExample/HomeView.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
16+
import SwiftUI
1717

1818
/// The view that is displayed after successfully signing in.
1919
struct HomeView: View {
2020
/// The portal that the user is signed in to.
21-
@State var portal: Portal?
21+
@State private var portal: Portal?
2222

2323
/// A Boolean value indicating whether the profile view should be presented.
24-
@State var showProfile = false
24+
@State private var showProfile = false
2525

2626
var body: some View {
2727
if let portal = portal {
28-
NavigationView{
28+
NavigationStack {
2929
WebMapsView(portal: portal)
3030
.toolbar {
3131
ToolbarItem(placement: .navigationBarTrailing) {
@@ -42,7 +42,6 @@ struct HomeView: View {
4242
}
4343
}
4444
}
45-
.navigationViewStyle(.stack)
4645
} else {
4746
SignInView(portal: $portal)
4847
}

AuthenticationExample/AuthenticationExample/LoadableImageView.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
16+
import SwiftUI
1717

1818
/// A view that loads a `LoadableImage` and displays it.
1919
/// While the image is loading a progress view is displayed.
2020
/// If there is an error displaying the image a red exclamation circle is displayed.
21+
@MainActor
2122
struct LoadableImageView: View {
2223
/// The loadable image to display.
2324
let loadableImage: LoadableImage
2425

2526
/// The result of loading the image.
26-
@State var result: Result<UIImage, Error>? = nil
27+
@State private var result: Result<UIImage, Error>?
2728

2829
var body: some View {
2930
Group {
@@ -38,7 +39,8 @@ struct LoadableImageView: View {
3839
Image(uiImage: image)
3940
.resizable()
4041
}
41-
}.task {
42+
}
43+
.task {
4244
result = await Result {
4345
try await loadableImage.load()
4446
return loadableImage.image ?? UIImage()

AuthenticationExample/AuthenticationExample/MapItemView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
16+
import SwiftUI
1717

1818
/// A view that displays a map.
19+
@MainActor
1920
struct MapItemView: View {
2021
/// The map that is to be displayed.
2122
let map: Map
2223

2324
/// The result of loading the map.
24-
@State var loadResult: Result<Void, Error>?
25+
@State private var loadResult: Result<Void, Error>?
2526

2627
var body: some View {
2728
VStack {
@@ -43,4 +44,3 @@ struct MapItemView: View {
4344
}
4445
}
4546
}
46-

AuthenticationExample/AuthenticationExample/ProfileView.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
1716
import ArcGISToolkit
17+
import SwiftUI
1818

1919
/// A view that displays the profile of a user.
20+
@MainActor
2021
struct ProfileView: View {
2122
/// The portal that the user is signed in to.
22-
@State var portal: Portal
23+
let portal: Portal
2324

2425
/// A Boolean indicating whether the user is signing out.
25-
@State var isSigningOut: Bool = false
26+
@State private var isSigningOut = false
2627

2728
/// The closure to call once the user has signed out.
2829
var signOutAction: () -> Void

AuthenticationExample/AuthenticationExample/SignInView.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
1716
import ArcGISToolkit
1817
import CryptoKit
18+
import SwiftUI
1919

2020
/// A view that allows the user to sign in to a portal.
21-
struct SignInView: View {
21+
@MainActor
22+
struct SignInView: View {
2223
/// The error that occurred during an attempt to sign in.
23-
@State var error: Error?
24+
@State private var error: Error?
2425

2526
/// A Boolean value indicating if the user is currently signing in.
26-
@State var isSigningIn: Bool = false
27+
@State private var isSigningIn = false
2728

2829
/// The portal that the user successfully signed in to.
2930
@Binding var portal: Portal?
@@ -34,7 +35,7 @@ struct SignInView: View {
3435
/// credential did not have a username.
3536
/// - If the property is non-nil and non-empty, then it contains the previously used and
3637
/// persisted username.
37-
@State var lastSignedInUser: String?
38+
@State private var lastSignedInUser: String?
3839

3940
var body: some View {
4041
VStack {

AuthenticationExample/AuthenticationExample/UserView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
16+
import SwiftUI
1717

1818
/// A view that displays details of a portal user.
1919
struct UserView: View {
2020
/// The user to display the details for.
21-
@State var user: PortalUser
21+
let user: PortalUser
2222

2323
var body: some View {
2424
VStack {

AuthenticationExample/AuthenticationExample/WebMapsView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import SwiftUI
1615
import ArcGIS
16+
import SwiftUI
1717

1818
/// A view that displays the web maps of a portal.
1919
struct WebMapsView: View {
2020
/// The portal from which the web maps can be fetched.
2121
var portal: Portal
2222

2323
/// A Boolean value indicating whether the featured content is being loaded.
24-
@State var isLoading = true
24+
@State private var isLoading = true
2525

2626
/// The web map portal items.
27-
@State var webMapItems = [PortalItem]()
27+
@State private var webMapItems = [PortalItem]()
2828

2929
var body: some View {
3030
VStack {

0 commit comments

Comments
 (0)