Skip to content

Commit 95179f7

Browse files
committed
Bump to swift 5.9
1 parent 9afcb06 commit 95179f7

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version: 5.6
1+
// swift-tools-version: 5.9
22

33
import PackageDescription
44

55
let package = Package(
66
name: "UpgradeAlert", // Set the name of the package
7-
platforms: [.iOS(.v15), .macOS(.v12)], // Set the supported platforms
7+
platforms: [.iOS(.v17), .macOS(.v14)], // Set the supported platforms
88
products: [
99
.library(
1010
name: "UpgradeAlert", // Set the name of the library

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,4 @@ UpgradeAlert.showAlert(appInfo: .init(version: "1.0.1", trackViewUrl: "https://a
103103
- NSAlert+Ext.swift: The method for presenting alerts in macOS could be refactored to reduce duplication and improve error handling.
104104
- Testing and Coverage Improving tests to cover edge cases and error scenarios would enhance the reliability of the application. For instance:
105105
- UpgradeAlertTests.swift: The test cases could be expanded to cover more scenarios, including error handling and user interaction outcomes.
106+
- Upgrade this to Swift 6.0 (Might be a bit tricky)

Sources/UpgradeAlert/UpgradeAlert+Variables.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ extension UpgradeAlert {
5252
* observe the results of the update check or alert
5353
* interaction.
5454
*/
55-
public static let defaultComplete: Complete = { (outcome: UAOutcome) in
56-
Swift.print("default complete - outcome: \(String(describing: outcome))")
55+
public static var defaultComplete: Complete {
56+
{ (outcome: UAOutcome) in
57+
Swift.print("default complete - outcome: \(String(describing: outcome))")
58+
}
5759
}
5860
}
5961
/**
@@ -66,5 +68,5 @@ extension UpgradeAlert {
6668
* system, which can be customized as needed.
6769
* - Note: By default, it uses the default configuration defined in UAConfig.
6870
*/
69-
public static var config: UAConfig = .defaultConfig
71+
public static var config: UAConfig { .defaultConfig }
7072
}

Sources/UpgradeAlert/ext/Bundle+Ext.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ extension Bundle {
4040
* - Note: If it fails there might be a fix here: https://stackoverflow.com/a/52232267/5389500
4141
* - Note: Seems like this can determine if an app is beta: https://developer.apple.com/documentation/appstoreconnectapi/list_all_builds_of_an_app
4242
* - Fixme: ⚠️️ Here is code that checks if something is testflight: https://gist.github.com/lukaskubanek/cbfcab29c0c93e0e9e0a16ab09586996
43-
* fix. we could make BundleError enum BundleError: Error { case appStoreReceiptURLNotFound }
43+
* - Fixme: ⚠️️ 'appStoreReceiptURL' was deprecated in macOS 15.0: Use AppTransaction.shared and Transaction.all from StoreKit.framework instead
44+
* - Fixme: ⚠️️ We could make BundleError enum BundleError: Error { case appStoreReceiptURLNotFound }
4445
* Example: `let isBeta = Bundle.isBeta`
4546
*/
4647
public static var isBeta: Bool { // was named: isSimulatorOrTestFlight

Sources/UpgradeAlert/helper/UAConfig.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension UAConfig {
6060
* suitable for general use cases where a specific
6161
* configuration is not necessary.
6262
*/
63-
public static let defaultConfig: UAConfig = {
63+
public static var defaultConfig: UAConfig {
6464
.init(
6565
isRequired: false, // By default, upgrades are not mandatory.
6666
alertTitle: "Update available", // Default alert title.
@@ -76,5 +76,5 @@ extension UAConfig {
7676
laterButtonTitle: "Later", // Default 'Later' button title.
7777
updateButtonTitle: "Update Now" // Default 'Update' button title.
7878
)
79-
}()
79+
}
8080
}

0 commit comments

Comments
 (0)