Swift 6 mode

This commit is contained in:
Thomas Ricouard 2024-08-12 21:55:56 +02:00
parent cf38a77105
commit b56ed36f17
17 changed files with 52 additions and 26 deletions

View file

@ -1275,7 +1275,7 @@
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@ -1310,7 +1310,7 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@ -1345,7 +1345,7 @@
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@ -1379,7 +1379,7 @@
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@ -1448,6 +1448,7 @@
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete; SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = "";
}; };
name = Debug; name = Debug;
}; };
@ -1507,6 +1508,7 @@
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = complete; SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = "";
}; };
name = Release; name = Release;
}; };
@ -1571,7 +1573,7 @@
SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES; SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES;
SWIFT_UPCOMING_FEATURE_ISOLATED_DEFAULT_VALUES = YES; SWIFT_UPCOMING_FEATURE_ISOLATED_DEFAULT_VALUES = YES;
SWIFT_UPCOMING_FEATURE_REGION_BASED_ISOLATION = YES; SWIFT_UPCOMING_FEATURE_REGION_BASED_ISOLATION = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,7"; TARGETED_DEVICE_FAMILY = "1,2,7";
_EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = NO; _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = NO;
}; };
@ -1638,7 +1640,7 @@
SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES; SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES;
SWIFT_UPCOMING_FEATURE_ISOLATED_DEFAULT_VALUES = YES; SWIFT_UPCOMING_FEATURE_ISOLATED_DEFAULT_VALUES = YES;
SWIFT_UPCOMING_FEATURE_REGION_BASED_ISOLATION = YES; SWIFT_UPCOMING_FEATURE_REGION_BASED_ISOLATION = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,7"; TARGETED_DEVICE_FAMILY = "1,2,7";
_EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = NO; _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = NO;
}; };
@ -1674,7 +1676,7 @@
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@ -1709,7 +1711,7 @@
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };

View file

@ -13,13 +13,17 @@ class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)? var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent? var bestAttemptContent: UNMutableNotificationContent?
@MainActor override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { private let pushKeys = PushKeys()
@MainActor
override func didReceive(_ request: UNNotificationRequest,
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if var bestAttemptContent { if var bestAttemptContent {
let privateKey = PushNotificationsService.shared.notificationsPrivateKeyAsKey let privateKey = pushKeys.notificationsPrivateKeyAsKey
let auth = PushNotificationsService.shared.notificationsAuthKeyAsKey let auth = pushKeys.notificationsAuthKeyAsKey
guard let encodedPayload = bestAttemptContent.userInfo["m"] as? String, guard let encodedPayload = bestAttemptContent.userInfo["m"] as? String,
let payload = Data(base64Encoded: encodedPayload.URLSafeBase64ToBase64()) let payload = Data(base64Encoded: encodedPayload.URLSafeBase64ToBase64())

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -34,6 +34,7 @@ let package = Package(
.product(name: "ButtonKit", package: "ButtonKit"), .product(name: "ButtonKit", package: "ButtonKit"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -32,6 +32,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -32,6 +32,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -33,6 +33,7 @@ let package = Package(
.product(name: "EmojiText", package: "EmojiText"), .product(name: "EmojiText", package: "EmojiText"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -29,6 +29,13 @@ import UIKit
override public init() { override public init() {
super.init() super.init()
Task { @MainActor in
setup()
}
}
private func setup() {
#if os(visionOS) #if os(visionOS)
windowWidth = window?.bounds.size.width ?? 0 windowWidth = window?.bounds.size.width ?? 0
windowHeight = window?.bounds.size.height ?? 0 windowHeight = window?.bounds.size.height ?? 0

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -30,6 +30,7 @@ let package = Package(
.product(name: "KeychainSwift", package: "keychain-swift"), .product(name: "KeychainSwift", package: "keychain-swift"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -36,6 +36,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -34,6 +34,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -28,6 +28,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -26,6 +26,7 @@ let package = Package(
"SwiftSoup", "SwiftSoup",
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -26,6 +26,7 @@ let package = Package(
.product(name: "Models", package: "Models"), .product(name: "Models", package: "Models"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -34,6 +34,7 @@ let package = Package(
.product(name: "DesignSystem", package: "DesignSystem"), .product(name: "DesignSystem", package: "DesignSystem"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -38,6 +38,7 @@ let package = Package(
.product(name: "LRUCache", package: "LRUCache"), .product(name: "LRUCache", package: "LRUCache"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),

View file

@ -1,5 +1,5 @@
@preconcurrency import AVFoundation import AVFoundation
import Foundation @preconcurrency import Foundation
import PhotosUI import PhotosUI
import SwiftUI import SwiftUI
import UIKit import UIKit

View file

@ -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. // The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
@ -38,6 +38,7 @@ let package = Package(
.product(name: "Bodega", package: "Bodega"), .product(name: "Bodega", package: "Bodega"),
], ],
swiftSettings: [ swiftSettings: [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("StrictConcurrency"), .enableExperimentalFeature("StrictConcurrency"),
] ]
), ),