Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Example/GradientLoadingBarExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand Down
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

import PackageDescription

let swiftSettings: [SwiftSetting] = [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
.enableUpcomingFeature("InferIsolatedConformances"),
.enableUpcomingFeature("InternalImportsByDefault"),
]

let package = Package(
name: "GradientLoadingBar",
platforms: [.iOS(.v26)],
Expand All @@ -24,6 +32,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",
Expand All @@ -40,6 +49,7 @@ let package = Package(
resources: [
.copy("SnapshotTests/__Snapshots__"),
],
swiftSettings: swiftSettings,
),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2019 Felix Mau. All rights reserved.
//

import CoreGraphics
public import CoreGraphics

public extension CGFloat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2019 Felix Mau. All rights reserved.
//

import Foundation
public import Foundation

public extension TimeInterval {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright © 2019 Felix Mau. All rights reserved.
//

import SwiftUI
import UIKit
public import SwiftUI
public import UIKit

public extension UIColor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<AnyCancellable>()
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading