Skip to content

Commit ecf7eac

Browse files
authored
Merge pull request #38 from fxm90/feature/enable-upcoming-features
Enable upcoming Swift features
2 parents 6094422 + cbe79a5 commit ecf7eac

12 files changed

Lines changed: 30 additions & 18 deletions

File tree

‎Example/GradientLoadingBarExample.xcodeproj/project.pbxproj‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@
287287
SWIFT_APPROACHABLE_CONCURRENCY = YES;
288288
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
289289
SWIFT_EMIT_LOC_STRINGS = YES;
290+
SWIFT_UPCOMING_FEATURE_EXISTENTIAL_ANY = YES;
290291
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
291-
SWIFT_VERSION = 5.0;
292+
SWIFT_VERSION = 6.0;
292293
TARGETED_DEVICE_FAMILY = "1,2,7";
293294
XROS_DEPLOYMENT_TARGET = 26.2;
294295
};
@@ -331,8 +332,9 @@
331332
SWIFT_APPROACHABLE_CONCURRENCY = YES;
332333
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
333334
SWIFT_EMIT_LOC_STRINGS = YES;
335+
SWIFT_UPCOMING_FEATURE_EXISTENTIAL_ANY = YES;
334336
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
335-
SWIFT_VERSION = 5.0;
337+
SWIFT_VERSION = 6.0;
336338
TARGETED_DEVICE_FAMILY = "1,2,7";
337339
XROS_DEPLOYMENT_TARGET = 26.2;
338340
};

‎Package.swift‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
import PackageDescription
55

6+
let swiftSettings: [SwiftSetting] = [
7+
.enableUpcomingFeature("ExistentialAny"),
8+
.enableUpcomingFeature("MemberImportVisibility"),
9+
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
10+
.enableUpcomingFeature("InferIsolatedConformances"),
11+
.enableUpcomingFeature("InternalImportsByDefault"),
12+
]
13+
614
let package = Package(
715
name: "GradientLoadingBar",
816
platforms: [.iOS(.v26)],
@@ -24,6 +32,7 @@ let package = Package(
2432
// Targets can depend on other targets in this package and products from dependencies.
2533
.target(
2634
name: "GradientLoadingBar",
35+
swiftSettings: swiftSettings,
2736
),
2837
.testTarget(
2938
name: "GradientLoadingBarTests",
@@ -40,6 +49,7 @@ let package = Package(
4049
resources: [
4150
.copy("SnapshotTests/__Snapshots__"),
4251
],
52+
swiftSettings: swiftSettings,
4353
),
4454
],
4555
)

‎Sources/GradientLoadingBar/Config/CGFloat+GradientLoadingBar.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2019 Felix Mau. All rights reserved.
77
//
88

9-
import CoreGraphics
9+
public import CoreGraphics
1010

1111
public extension CGFloat {
1212

‎Sources/GradientLoadingBar/Config/TimeInterval+GradientLoadingBar.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2019 Felix Mau. All rights reserved.
77
//
88

9-
import Foundation
9+
public import Foundation
1010

1111
public extension TimeInterval {
1212

‎Sources/GradientLoadingBar/Config/UIColor+GradientLoadingBar.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// Copyright © 2019 Felix Mau. All rights reserved.
77
//
88

9-
import SwiftUI
10-
import UIKit
9+
public import SwiftUI
10+
public import UIKit
1111

1212
public extension UIColor {
1313

‎Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/GradientActivityIndicatorView.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2016 Felix Mau. All rights reserved.
77
//
88

9-
import UIKit
9+
public import UIKit
1010

1111
/// A view that displays an animated horizontal gradient, commonly used as a loading indicator.
1212
///

‎Sources/GradientLoadingBar/Features/GradientActivityIndicatorView/Utilities/GradientActivityIndicatorView+AnimateIsHidden.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2018 Felix Mau. All rights reserved.
77
//
88

9-
import UIKit
9+
public import UIKit
1010

1111
/// Convenience animation helpers for `GradientActivityIndicatorView` that
1212
/// fade the view in and out while keeping the `isHidden` flag in sync.

‎Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController+ViewModel.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension GradientLoadingBarController {
4343
// MARK: - Instance Lifecycle
4444

4545
init(
46-
sharedApplication: UIApplicationProtocol = UIApplication.shared,
46+
sharedApplication: any UIApplicationProtocol = UIApplication.shared,
4747
notificationCenter: NotificationCenter = .default,
4848
) {
4949
if let keyWindow = sharedApplication.firstKeyWindow {

‎Sources/GradientLoadingBar/Features/GradientLoadingBarController/GradientLoadingBarController.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
import Combine
10-
import UIKit
10+
public import UIKit
1111

1212
/// Type-alias for the controller to match the package name.
1313
public typealias GradientLoadingBar = GradientLoadingBarController
@@ -128,7 +128,7 @@ public class GradientLoadingBarController {
128128
private let isRelativeToSafeArea: Bool
129129

130130
/// The view model for our controller.
131-
private let viewModel: GradientLoadingBarViewModel
131+
private let viewModel: any GradientLoadingBarViewModel
132132

133133
/// The dispose bag for the observables.
134134
private var subscriptions = Set<AnyCancellable>()
@@ -140,7 +140,7 @@ public class GradientLoadingBarController {
140140
init(
141141
height: CGFloat,
142142
isRelativeToSafeArea: Bool,
143-
gradientLoadingBarViewModel viewModel: GradientLoadingBarViewModel,
143+
gradientLoadingBarViewModel viewModel: any GradientLoadingBarViewModel,
144144
) {
145145
self.height = height
146146
self.isRelativeToSafeArea = isRelativeToSafeArea

‎Sources/GradientLoadingBar/Features/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extension GradientLoadingBarView {
1414
/// This view model contains all logic related to the `GradientLoadingBarView`
1515
/// and the corresponding progress animation.
1616
@Observable
17-
final class ViewModel: ObservableObject {
17+
final class ViewModel {
1818

1919
// MARK: - Internal Properties
2020

0 commit comments

Comments
 (0)