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

Migrate to Xcode 16 minimum #883

Draft
wants to merge 38 commits into
base: v.next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c409e59
Bump `LastUpgradeVersion`
dfeinzimer Sep 20, 2024
deaaba5
Bump swift-tools-version
dfeinzimer Sep 20, 2024
3b476ef
Add SWIFT_VERSION to "Examples" project
dfeinzimer Sep 20, 2024
6c4a6af
Bump SWIFT_VERSION to 6.0 for Toolkit Examples target
dfeinzimer Sep 20, 2024
ba11e27
Specify Swift 6 for Authentication project and target
dfeinzimer Sep 20, 2024
b94cece
Specify Swift 6 for Job Manager project and target
dfeinzimer Sep 20, 2024
374baf2
Specify Swift 6 for Test Runner project and targets
dfeinzimer Sep 20, 2024
24f41de
Bump LastUpgradeVersion in other schemes
dfeinzimer Sep 20, 2024
5aca095
Update FlyoverExampleView.swift
dfeinzimer Sep 21, 2024
35a7c59
Fix error in `UtilityNetworkTraceViewModel.addStartingPoints(at:mapPo…
dfeinzimer Sep 21, 2024
05b4c65
Fix error in `AttachmentCameraController.onCameraCaptureModeChanged(p…
dfeinzimer Sep 21, 2024
3401c02
Fix error in `AttachmentCameraController.onCameraCaptureModeChanged(p…
dfeinzimer Sep 21, 2024
89c22a0
Remove experimental and upcoming feature flags
dfeinzimer Sep 23, 2024
aae526d
Add missing default case to `TextFormElementView`
dfeinzimer Sep 23, 2024
317758b
Bump `objectVersion` to `77`
dfeinzimer Sep 23, 2024
689075e
Bump `LastUpgradeCheck` to `1600`
dfeinzimer Sep 23, 2024
d5b28a4
Update FlyoverExampleView.swift
dfeinzimer Sep 23, 2024
b7414cc
Update TableTopExampleView.swift
dfeinzimer Sep 23, 2024
f13fa49
Update GroupView.swift
dfeinzimer Sep 23, 2024
10be361
Update HTMLTextView.swift
dfeinzimer Sep 23, 2024
edaa5cd
Fix `SearchSource` sendability errors
dfeinzimer Sep 24, 2024
abc22c4
Update ExampleView.swift
dfeinzimer Sep 24, 2024
ea5f86f
Update AnyExample.swift
dfeinzimer Sep 24, 2024
0d726f1
Drop `MainActor.runUnsafely`
dfeinzimer Sep 24, 2024
cb31175
Update ValueContinuation.swift
dfeinzimer Sep 24, 2024
1eba326
Drop older Xcode `compatibilityVersion`s
dfeinzimer Sep 24, 2024
9f22362
Add Xcode 16 `preferredProjectObjectVersion`
dfeinzimer Sep 24, 2024
aa4eded
Update LoginViewModifierTests.swift
dfeinzimer Sep 24, 2024
51f2f05
Update RepresentedUITextViewTests.swift
dfeinzimer Sep 24, 2024
88ce733
Update FormViewTests.swift
dfeinzimer Sep 24, 2024
5495f9a
Update FloorFilterTests.swift
dfeinzimer Sep 24, 2024
203dc65
Update BookmarksTests.swift
dfeinzimer Sep 24, 2024
24c7c12
Update BasemapGalleryTests.swift
dfeinzimer Sep 24, 2024
47aa4f7
Update AttachmentCameraControllerTests.swift
dfeinzimer Sep 24, 2024
47794ce
Merge branch 'v.next' into pr/883
dfeinzimer Sep 24, 2024
c90e603
Revert "Add missing default case to `TextFormElementView`"
dfeinzimer Sep 24, 2024
399a495
Update TableTopSceneView.swift
dfeinzimer Sep 27, 2024
a1d6d68
Merge branch 'v.next' into pr/883
dfeinzimer Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -133,22 +133,22 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastUpgradeCheck = 1530;
LastUpgradeCheck = 1600;
TargetAttributes = {
88AD13742834355000500B2E = {
CreatedOnToolsVersion = 13.2.1;
};
};
};
buildConfigurationList = 88AD13702834355000500B2E /* Build configuration list for PBXProject "AuthenticationExample" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 88AD136C2834355000500B2E;
preferredProjectObjectVersion = 77;
productRefGroup = 88AD13762834355000500B2E /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -270,6 +270,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -325,6 +326,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 6.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -359,7 +361,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -394,7 +396,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
12 changes: 7 additions & 5 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -199,22 +199,22 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1530;
LastUpgradeCheck = 1600;
TargetAttributes = {
E47ABE3F2652FE0900FD2FE3 = {
CreatedOnToolsVersion = 12.5;
};
};
};
buildConfigurationList = E47ABE3B2652FE0900FD2FE3 /* Build configuration list for PBXProject "Examples" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = E47ABE372652FE0900FD2FE3;
preferredProjectObjectVersion = 77;
productRefGroup = E47ABE412652FE0900FD2FE3 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -348,6 +348,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -403,6 +404,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 6.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -434,7 +436,7 @@
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Debug;
Expand Down Expand Up @@ -466,7 +468,7 @@
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Examples/Examples/FlyoverExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct FlyoverExampleView: View {
id: PortalItem.ID("7558ee942b2547019f66885c44d4f0b1")!
)
)

var body: some View {
FlyoverSceneView(
initialLocation: Point(x: 4.4777, y: 51.9244, z: 1_000, spatialReference: .wgs84),
Expand All @@ -32,7 +32,7 @@ struct FlyoverExampleView: View {
SceneView(scene: scene)
.onSingleTapGesture { screen, _ in
print("Identifying...")
Task.detached { @MainActor in
Task { @MainActor in
let results = try await proxy.identifyLayers(screenPoint: screen, tolerance: 20)
print("\(results.count) identify result(s).")
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/TableTopExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct TableTopExampleView: View {
SceneView(scene: scene)
.onSingleTapGesture { screen, _ in
print("Identifying...")
Task.detached { @MainActor in
Task { @MainActor in
let results = try await proxy.identifyLayers(screenPoint: screen, tolerance: 20)
print("\(results.count) identify result(s).")
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/ExamplesApp/AnyExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import SwiftUI

struct AnyExample<Content: View> {
var name: String
var content: @MainActor () -> Content
var content: () -> Content

init(_ name: String, content: @autoclosure @escaping @MainActor () -> Content) {
init(_ name: String, content: @autoclosure @escaping () -> Content) {
self.name = name
self.content = content
}
Expand Down
4 changes: 0 additions & 4 deletions Examples/ExamplesApp/ExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ struct ExampleView: View {
.navigationBarTitleDisplayMode(.inline)
}
}

extension ExampleView: Identifiable {
var id: String { example.name }
}
12 changes: 7 additions & 5 deletions JobManagerExample/JobManagerExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -116,22 +116,22 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1430;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1600;
TargetAttributes = {
88140D582A8BD940003F55D4 = {
CreatedOnToolsVersion = 14.3.1;
};
};
};
buildConfigurationList = 88140D542A8BD940003F55D4 /* Build configuration list for PBXProject "JobManagerExample" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 88140D502A8BD940003F55D4;
preferredProjectObjectVersion = 77;
productRefGroup = 88140D5A2A8BD940003F55D4 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -246,6 +246,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -299,6 +300,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 6.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -330,7 +332,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -362,7 +364,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 1 addition & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
// Copyright 2021 Esri
//
Expand Down Expand Up @@ -50,13 +50,3 @@ let package = Package(
)
]
)

for target in package.targets {
target.swiftSettings = (target.swiftSettings ?? []) + [
// Experimental Features.
.enableExperimentalFeature("AccessLevelOnImport"),
.enableExperimentalFeature("StrictConcurrency"),
// Upcoming Features.
.enableUpcomingFeature("DisableOutwardActorInference")
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public struct TableTopSceneView: View {
}
}

/// Sets the visibility of the coaching overlay view for the AR experince.
/// Sets the visibility of the coaching overlay view for the AR experience.
/// - Parameter hidden: A Boolean value that indicates whether to hide the
/// coaching overlay view.
public func coachingOverlayHidden(_ hidden: Bool) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ extension ARSwiftUIView {
}

/// A proxy for the ARSwiftUIView.
class ARSwiftUIViewProxy: NSObject, ARSessionProviding {
@MainActor
class ARSwiftUIViewProxy: NSObject, @preconcurrency ARSessionProviding, Sendable {
/// The underlying AR view.
/// This is set by the ARSwiftUIView when it is available.
fileprivate var arView: ARViewType!

/// The AR session.
@objc dynamic var session: ARSession {
MainActor.runUnsafely { arView.session }
arView.session
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import Foundation
func setValue(_ value: Value) {
guard _value == nil else { return }
_value = value
continuation?.resume(returning: value)
Task {
continuation?.resume(returning: value)
}
}

/// The value. This property supports only one consumer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ final class CameraControllerCoordinator: NSObject, UIImagePickerControllerDelega
extension AttachmentCameraController {
/// Specifies an action to perform when the camera capture mode has changed from photo to video or vice versa.
/// - Parameter action: The new camera capture mode.
func onCameraCaptureModeChanged(perform action: @escaping (_: UIImagePickerController.CameraCaptureMode) -> Void) -> Self {
func onCameraCaptureModeChanged(perform action: @Sendable @escaping (_: UIImagePickerController.CameraCaptureMode) -> Void) -> Self {
self.controller.action = action
return self
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ struct AttachmentImportMenu: View {
#if !targetEnvironment(macCatalyst) && !targetEnvironment(simulator)
.onCameraCaptureModeChanged { captureMode in
if captureMode == .video && AVCaptureDevice.authorizationStatus(for: .audio) == .denied {
microphoneAccessAlertIsVisible = true
Task { @MainActor in
microphoneAccessAlertIsVisible = true
}
}
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct GroupView<Content>: View where Content: View {
.onAppear {
isExpanded = element.initialState == .expanded
for element in element.elements {
let newTask = Task.detached { @MainActor [self] in
let newTask = Task { @MainActor [self] in
for await _ in element.$isVisible {
self.updateVisibleElements()
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ArcGISToolkit/Components/Popups/HTMLTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extension HTMLTextView.Coordinator: WKNavigationDelegate {
// `WKNavigationDelegate` method invoked when a main frame navigation completes. This is
// where the height calculation happens.
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
Task.detached { @MainActor [onHeightChanged] in
Task { @MainActor [onHeightChanged] in
guard let readyState = try? await webView.evaluateJavaScript("document.readyState") as? String,
readyState == "complete" else {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation

/// Uses a Locator to provide search and suggest results. Most configuration should be done on the
/// `GeocodeParameters` directly.
public class LocatorSearchSource: ObservableObject, SearchSource {
public class LocatorSearchSource: ObservableObject, SearchSource, @unchecked Sendable {
/// Creates a locator search source.
/// - Parameters:
/// - name: The name to show when presenting this source in the UI.
Expand Down
2 changes: 1 addition & 1 deletion Sources/ArcGISToolkit/Components/Search/SearchSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import ArcGIS

/// Defines the contract for a search result provider.
public protocol SearchSource {
public protocol SearchSource: Sendable {
Copy link
Contributor

Choose a reason for hiding this comment

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

While adopting the Sendable protocol is easy, doing so right can be hard. Neither of the conforming types are actually sendable nor would it be easy to make them so. That is why I didn't do this myself when enabling complete strict concurrency. We may end up having no other choice, but if so, we should make an effort to make the conforming types thread safe, as difficult as that will be. The best option is probably to re-design the API, but I don't think we want to do that right now.

/// Name to show when presenting this source in the UI.
var name: String { get set }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ArcGIS

/// Extends `LocatorSearchSource` with intelligent search behaviors; adds support for features like
/// type-specific placemarks, repeated search, and more on the world geocode service.
public class SmartLocatorSearchSource: LocatorSearchSource {
public class SmartLocatorSearchSource: LocatorSearchSource, @unchecked Sendable {
/// Creates a smart locator search source.
/// - Parameters:
/// - name: Name to show when presenting this source in the UI.
Expand Down
Loading