Skip to content

Commit

Permalink
Add Swift safety
Browse files Browse the repository at this point in the history
  • Loading branch information
s-faychatelard committed Sep 20, 2024
1 parent 615c0fc commit bcd7b09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -21,9 +21,18 @@ let package = Package(
.target(
name: "OCGoogleDirectionsAPI",
dependencies: [],
publicHeadersPath: "."),
publicHeadersPath: ".",
swiftSettings: .completeConcurrencyChecking),
.testTarget(
name: "OCGoogleDirectionsAPITests",
dependencies: ["OCGoogleDirectionsAPI"]),
]
)

extension Array where Element == SwiftSetting {
static let completeConcurrencyChecking: Self = [.completeConcurrencyChecking]
}

extension SwiftSetting {
static let completeConcurrencyChecking = Self.unsafeFlags(["-strict-concurrency=complete"])
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "RequestURLCreator/OCDirectionsRequestURLCreator.h"
#import "RequestURLCreator/OCDirectionsRequestURLCreatorJSON.h"

typedef void (^OCDirectionsRequestCallback)(OCDirectionsResponse *response, NSError *error);
typedef NS_SWIFT_UI_ACTOR NS_SWIFT_SENDABLE void (^OCDirectionsRequestCallback)(OCDirectionsResponse *response, NSError *error);

@interface OCDirectionsAPIClient : NSObject

Expand Down

0 comments on commit bcd7b09

Please sign in to comment.