From 694631dafc5df9ca40d7b357b69ddb9e0f2b9061 Mon Sep 17 00:00:00 2001 From: "Felix M." Date: Fri, 23 Oct 2026 22:41:53 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A7=20::=20Enable=20`ExistentialAn?= =?UTF-8?q?y`=20and=20`MemberImportVisibility`=20upcoming=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mark existential protocol types explicitly with `any`. - Remove unused `ObservableObject` conformance from the `@Observable` view model. Co-Authored-By: Claude Opus 5.5 --- Package.swift | 7 +++++++ .../GradientLoadingBarController+ViewModel.swift | 2 +- .../GradientLoadingBarController.swift | 4 ++-- .../GradientLoadingBarView+ViewModel.swift | 2 +- .../NotchGradientLoadingBarController.swift | 6 +++--- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index fcdec2b..ee3e63b 100644 --- a/Package.swift +++ b/Package.swift @@ -3,6 +3,11 @@ import PackageDescription +let swiftSettings: [SwiftSetting] = [ + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("MemberImportVisibility"), +] + let package = Package( name: "GradientLoadingBar", platforms: [.iOS(.v26)], @@ -24,6 +29,7 @@ let package = Package( // Targets can depend on other targets in this package and products from dependencies. .target( name: "GradientLoadingBar", + swiftSettings: swiftSettings, ), .testTarget( name: "GradientLoadingBarTests", @@ -40,6 +46,7 @@ let package = Package( resources: [ .copy("SnapshotTests/__Snapshots__"), ], + swiftSettings: swiftSettings, ), ], ) diff --git a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController+ViewModel.swift b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController+ViewModel.swift index 8db6f92..953403b 100644 --- a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController+ViewModel.swift +++ b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController+ViewModel.swift @@ -43,7 +43,7 @@ extension GradientLoadingBarController { // MARK: - Instance Lifecycle init( - sharedApplication: UIApplicationProtocol = UIApplication.shared, + sharedApplication: any UIApplicationProtocol = UIApplication.shared, notificationCenter: NotificationCenter = .default, ) { if let keyWindow = sharedApplication.firstKeyWindow { diff --git a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift index 3e460eb..5bc8226 100644 --- a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift +++ b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift @@ -128,7 +128,7 @@ public class GradientLoadingBarController { private let isRelativeToSafeArea: Bool /// The view model for our controller. - private let viewModel: GradientLoadingBarViewModel + private let viewModel: any GradientLoadingBarViewModel /// The dispose bag for the observables. private var subscriptions = Set() @@ -140,7 +140,7 @@ public class GradientLoadingBarController { init( height: CGFloat, isRelativeToSafeArea: Bool, - gradientLoadingBarViewModel viewModel: GradientLoadingBarViewModel, + gradientLoadingBarViewModel viewModel: any GradientLoadingBarViewModel, ) { self.height = height self.isRelativeToSafeArea = isRelativeToSafeArea diff --git a/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift b/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift index 39b1b80..c92f322 100644 --- a/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift +++ b/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift @@ -14,7 +14,7 @@ extension GradientLoadingBarView { /// This view model contains all logic related to the `GradientLoadingBarView` /// and the corresponding progress animation. @Observable - final class ViewModel: ObservableObject { + final class ViewModel { // MARK: - Internal Properties diff --git a/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift b/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift index c73c3e5..efbff6e 100644 --- a/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift +++ b/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift @@ -53,7 +53,7 @@ public class NotchGradientLoadingBarController: GradientLoadingBarController { // MARK: - Private Properties /// The view model for our controller. - private let viewModel: NotchGradientLoadingBarViewModel + private let viewModel: any NotchGradientLoadingBarViewModel // MARK: - Instance Lifecycle @@ -62,8 +62,8 @@ public class NotchGradientLoadingBarController: GradientLoadingBarController { init( height: CGFloat, isRelativeToSafeArea: Bool, - gradientLoadingBarViewModel: GradientLoadingBarViewModel, - notchGradientLoadingBarViewModel viewModel: NotchGradientLoadingBarViewModel, + gradientLoadingBarViewModel: any GradientLoadingBarViewModel, + notchGradientLoadingBarViewModel viewModel: any NotchGradientLoadingBarViewModel, ) { self.viewModel = viewModel From c0d26164b1db53a0a06b2b0c125c6bdd2cb65664 Mon Sep 17 00:00:00 2001 From: "Felix M." Date: Sat, 24 Oct 2026 08:45:43 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A7=20::=20Enable=20`NonisolatedNo?= =?UTF-8?q?nsendingByDefault`,=20`InferIsolatedConformances`=20and=20`Inte?= =?UTF-8?q?rnalImportsByDefault`=20upcoming=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mark imports of frameworks used in the public API as `public import`. Co-Authored-By: Claude Opus 5.5 --- Package.swift | 3 +++ .../Config/CGFloat+GradientLoadingBar.swift | 2 +- .../Config/TimeInterval+GradientLoadingBar.swift | 2 +- .../Config/UIColor+GradientLoadingBar.swift | 4 ++-- .../GradientActivityIndicatorView.swift | 2 +- .../GradientActivityIndicatorView+AnimateIsHidden.swift | 2 +- .../GradientLoadingBarController.swift | 2 +- .../GradientLoadingBarView/GradientLoadingBarView.swift | 2 +- .../NotchGradientLoadingBarController.swift | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Package.swift b/Package.swift index ee3e63b..6a0ea19 100644 --- a/Package.swift +++ b/Package.swift @@ -6,6 +6,9 @@ import PackageDescription let swiftSettings: [SwiftSetting] = [ .enableUpcomingFeature("ExistentialAny"), .enableUpcomingFeature("MemberImportVisibility"), + .enableUpcomingFeature("NonisolatedNonsendingByDefault"), + .enableUpcomingFeature("InferIsolatedConformances"), + .enableUpcomingFeature("InternalImportsByDefault"), ] let package = Package( diff --git a/Sources/GradientLoadingBar/Config/CGFloat+GradientLoadingBar.swift b/Sources/GradientLoadingBar/Config/CGFloat+GradientLoadingBar.swift index cde29b8..2265b2f 100644 --- a/Sources/GradientLoadingBar/Config/CGFloat+GradientLoadingBar.swift +++ b/Sources/GradientLoadingBar/Config/CGFloat+GradientLoadingBar.swift @@ -6,7 +6,7 @@ // Copyright © 2019 Felix Mau. All rights reserved. // -import CoreGraphics +public import CoreGraphics public extension CGFloat { diff --git a/Sources/GradientLoadingBar/Config/TimeInterval+GradientLoadingBar.swift b/Sources/GradientLoadingBar/Config/TimeInterval+GradientLoadingBar.swift index 912edbd..a41d23f 100644 --- a/Sources/GradientLoadingBar/Config/TimeInterval+GradientLoadingBar.swift +++ b/Sources/GradientLoadingBar/Config/TimeInterval+GradientLoadingBar.swift @@ -6,7 +6,7 @@ // Copyright © 2019 Felix Mau. All rights reserved. // -import Foundation +public import Foundation public extension TimeInterval { diff --git a/Sources/GradientLoadingBar/Config/UIColor+GradientLoadingBar.swift b/Sources/GradientLoadingBar/Config/UIColor+GradientLoadingBar.swift index 764d61c..264411f 100644 --- a/Sources/GradientLoadingBar/Config/UIColor+GradientLoadingBar.swift +++ b/Sources/GradientLoadingBar/Config/UIColor+GradientLoadingBar.swift @@ -6,8 +6,8 @@ // Copyright © 2019 Felix Mau. All rights reserved. // -import SwiftUI -import UIKit +public import SwiftUI +public import UIKit public extension UIColor { diff --git a/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/GradientActivityIndicatorView.swift b/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/GradientActivityIndicatorView.swift index 4d120ec..e349710 100644 --- a/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/GradientActivityIndicatorView.swift +++ b/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/GradientActivityIndicatorView.swift @@ -6,7 +6,7 @@ // Copyright © 2016 Felix Mau. All rights reserved. // -import UIKit +public import UIKit /// A view that displays an animated horizontal gradient, commonly used as a loading indicator. /// diff --git a/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/Utilities/GradientActivityIndicatorView+AnimateIsHidden.swift b/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/Utilities/GradientActivityIndicatorView+AnimateIsHidden.swift index 6ee4618..d37e0b4 100644 --- a/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/Utilities/GradientActivityIndicatorView+AnimateIsHidden.swift +++ b/Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/Utilities/GradientActivityIndicatorView+AnimateIsHidden.swift @@ -6,7 +6,7 @@ // Copyright © 2018 Felix Mau. All rights reserved. // -import UIKit +public import UIKit /// Convenience animation helpers for `GradientActivityIndicatorView` that /// fade the view in and out while keeping the `isHidden` flag in sync. diff --git a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift index 5bc8226..d8cb817 100644 --- a/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift +++ b/Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift @@ -7,7 +7,7 @@ // import Combine -import UIKit +public import UIKit /// Type-alias for the controller to match the package name. public typealias GradientLoadingBar = GradientLoadingBarController diff --git a/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView.swift b/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView.swift index 1117ba4..d1cf817 100644 --- a/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView.swift +++ b/Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView.swift @@ -6,7 +6,7 @@ // Copyright © 2022 Felix Mau. All rights reserved. // -import SwiftUI +public import SwiftUI import UIKit /// A SwiftUI view that displays an animated horizontal gradient, commonly used as a loading indicator. diff --git a/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift b/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift index efbff6e..3ca56d0 100644 --- a/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift +++ b/Sources/GradientLoadingBar/Features/NotchGradientLoadingBarController/NotchGradientLoadingBarController.swift @@ -6,7 +6,7 @@ // Copyright © 2020 Felix Mau. All rights reserved. // -import UIKit +public import UIKit /// Type-alias for the controller to match the package name. public typealias NotchGradientLoadingBar = NotchGradientLoadingBarController From cbe79a55a9efd2658847f133aa407b9314786ae0 Mon Sep 17 00:00:00 2001 From: "Felix M." Date: Sat, 24 Oct 2026 11:12:24 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A7=20::=20Use=20Swift=206=20langu?= =?UTF-8?q?age=20mode=20and=20enable=20`ExistentialAny`=20in=20example=20a?= =?UTF-8?q?pplication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- Example/GradientLoadingBarExample.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Example/GradientLoadingBarExample.xcodeproj/project.pbxproj b/Example/GradientLoadingBarExample.xcodeproj/project.pbxproj index 2db80d2..f27d070 100644 --- a/Example/GradientLoadingBarExample.xcodeproj/project.pbxproj +++ b/Example/GradientLoadingBarExample.xcodeproj/project.pbxproj @@ -287,8 +287,9 @@ SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_EXISTENTIAL_ANY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,7"; XROS_DEPLOYMENT_TARGET = 26.2; }; @@ -331,8 +332,9 @@ SWIFT_APPROACHABLE_CONCURRENCY = YES; SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_EXISTENTIAL_ANY = YES; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,7"; XROS_DEPLOYMENT_TARGET = 26.2; };