diff --git a/Package.swift b/Package.swift index c961e5a..49b5efe 100644 --- a/Package.swift +++ b/Package.swift @@ -11,10 +11,13 @@ let productionDependencies: [PackageDescription.Package.Dependency] = { [ .package(url: "https://github.com/oversizedev/OversizeComponents.git", .upToNextMajor(from: "1.2.0")), .package(url: "https://github.com/oversizedev/OversizeResources.git", .upToNextMajor(from: "1.3.0")), .package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")), -// .package(name: "OversizeNetwork", path: "../OversizeNetwork"), -// .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")), -// .package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")), - // .package(url: "https://github.com/oversizedev/OversizeNetwork.git", .upToNextMajor(from: "0.1.0")) + .package(url: "https://github.com/lorenzofiamingo/swiftui-cached-async-image.git", .upToNextMajor(from: "2.1.1")), + /* + .package(name: "OversizeNetwork", path: "../OversizeNetwork"), + .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")), + .package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")), + .package(url: "https://github.com/oversizedev/OversizeNetwork.git", .upToNextMajor(from: "0.1.0")) + */ ] }() let developmentDependencies: [PackageDescription.Package.Dependency] = { [ @@ -25,9 +28,12 @@ let developmentDependencies: [PackageDescription.Package.Dependency] = { [ .package(name: "OversizeComponents", path: "../OversizeComponents"), .package(name: "OversizeResources", path: "../OversizeResources"), .package(name: "OversizeNetwork", path: "../OversizeNetwork"), -// .package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")), -// .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")), -// .package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")), + .package(url: "https://github.com/lorenzofiamingo/swiftui-cached-async-image.git", .upToNextMajor(from: "2.1.1")), + /* + .package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")), + .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")), + .package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")), + */ ] }() let package = Package( @@ -63,6 +69,7 @@ let package = Package( .product(name: "OversizeResources", package: "OversizeResources"), .product(name: "OversizeNotificationService", package: "OversizeServices"), .product(name: "Factory", package: "Factory"), + .product(name: "CachedAsyncImage", package: "swiftui-cached-async-image"), ] ), .target( @@ -72,12 +79,15 @@ let package = Package( .product(name: "Factory", package: "Factory"), .product(name: "OversizeUI", package: "OversizeUI"), .product(name: "OversizeServices", package: "OversizeServices"), -// .product(name: "OversizeNetwork", package: "OversizeNetwork"), -// .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), -// .product( -// name: "OpenAPIURLSession", -// package: "swift-openapi-urlsession" -// ), + .product(name: "CachedAsyncImage", package: "swiftui-cached-async-image"), + /* + .product(name: "OversizeNetwork", package: "OversizeNetwork"), + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product( + name: "OpenAPIURLSession", + package: "swift-openapi-urlsession" + ), + */ ] ), .target( diff --git a/Sources/OversizeAdsKit/AdView.swift b/Sources/OversizeAdsKit/AdView.swift index 2cff439..6b14cd4 100644 --- a/Sources/OversizeAdsKit/AdView.swift +++ b/Sources/OversizeAdsKit/AdView.swift @@ -3,6 +3,7 @@ // AdView.swift // +import CachedAsyncImage import OversizeKit import OversizeServices import OversizeUI @@ -36,7 +37,7 @@ public struct AdView: View { var premiumBanner: some View { HStack(spacing: .zero) { - AsyncImage(url: URL(string: "\(Info.links?.company.cdnString ?? "")/assets/apps/\(viewModel.appAd?.path ?? "")/icon.png"), content: { + CachedAsyncImage(url: URL(string: "\(Info.links?.company.cdnString ?? "")/assets/apps/\(viewModel.appAd?.path ?? "")/icon.png"), content: { $0 .resizable() .frame(width: 64, height: 64) diff --git a/Sources/OversizeKit/SettingsKit/Views/About/AboutView.swift b/Sources/OversizeKit/SettingsKit/Views/About/AboutView.swift index c6589a8..1533a10 100644 --- a/Sources/OversizeKit/SettingsKit/Views/About/AboutView.swift +++ b/Sources/OversizeKit/SettingsKit/Views/About/AboutView.swift @@ -3,6 +3,7 @@ // AboutView.swift // +import CachedAsyncImage import OversizeComponents import OversizeLocalizable import OversizeResources @@ -203,7 +204,7 @@ import SwiftUI } label: { VStack(spacing: .xSmall) { let imageUrl = "\(Info.links?.company.cdnString ?? "")/assets/apps/\(app.path ?? "")/icon.png" - AsyncImage(url: URL(string: imageUrl), content: { + CachedAsyncImage(url: URL(string: imageUrl), content: { $0 .resizable() .frame(width: 74, height: 74) @@ -373,7 +374,7 @@ import SwiftUI HStack { VStack(alignment: .center) { ZStack(alignment: .top) { - AsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer3.png"), scale: scale) { + CachedAsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer3.png"), scale: scale) { $0 .resizable() .scaledToFit() @@ -387,7 +388,7 @@ import SwiftUI } .offset(y: -offset * 0.1) - AsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer2.png"), scale: scale) { + CachedAsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer2.png"), scale: scale) { $0 .resizable() .scaledToFit() @@ -403,7 +404,7 @@ import SwiftUI } } - AsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer1.png"), scale: scale) { + CachedAsyncImage(url: URL(string: "https://cdn.oversize.design/assets/illustrations/scenes/about-layer1.png"), scale: scale) { $0 .resizable() .scaledToFit() diff --git a/Sources/OversizeKit/SettingsKit/Views/SettingsView.swift b/Sources/OversizeKit/SettingsKit/Views/SettingsView.swift index ae4e8fe..3cb339f 100644 --- a/Sources/OversizeKit/SettingsKit/Views/SettingsView.swift +++ b/Sources/OversizeKit/SettingsKit/Views/SettingsView.swift @@ -292,7 +292,7 @@ import SwiftUI .buttonStyle(.row) .sheet(isPresented: $isShowFeedback) { FeedbackView() - .presentationDetents([.height(600)]) + .presentationDetents([.height(560)]) .presentationContentInteraction(.resizes) .presentationCompactAdaptation(.sheet) .scrollDisabled(true) diff --git a/Sources/OversizeKit/StoreKit/Views/StoreFeatureDetailView.swift b/Sources/OversizeKit/StoreKit/Views/StoreFeatureDetailView.swift index 79e0f24..2a3c9dd 100644 --- a/Sources/OversizeKit/StoreKit/Views/StoreFeatureDetailView.swift +++ b/Sources/OversizeKit/StoreKit/Views/StoreFeatureDetailView.swift @@ -3,6 +3,7 @@ // StoreFeatureDetailView.swift // +import CachedAsyncImage import OversizeComponents import OversizeCore import OversizeResources @@ -107,7 +108,7 @@ struct StoreFeatureDetailView: View { func iconFetureItem(_ feature: PlistConfiguration.Store.StoreFeature, geometry: GeometryProxy) -> some View { VStack(spacing: .xxxSmall) { if let IllustrationURLPath = feature.illustrationURL { - AsyncImage(url: URL(string: IllustrationURLPath)) { image in + CachedAsyncImage(url: URL(string: IllustrationURLPath)) { image in image .resizable() .scaledToFill() diff --git a/Sources/OversizeKit/StoreKit/Views/StoreFeaturesLargeView.swift b/Sources/OversizeKit/StoreKit/Views/StoreFeaturesLargeView.swift index 35ba667..81b458b 100644 --- a/Sources/OversizeKit/StoreKit/Views/StoreFeaturesLargeView.swift +++ b/Sources/OversizeKit/StoreKit/Views/StoreFeaturesLargeView.swift @@ -3,6 +3,7 @@ // StoreFeaturesLargeView.swift // +import CachedAsyncImage import OversizeComponents import OversizeResources import OversizeServices @@ -73,7 +74,7 @@ struct StoreFeaturesLargeView: View { func fetureItem(_ feature: PlistConfiguration.Store.StoreFeature) -> some View { VStack(spacing: .zero) { if let IllustrationURLPath = feature.illustrationURL { - AsyncImage(url: URL(string: IllustrationURLPath)) { image in + CachedAsyncImage(url: URL(string: IllustrationURLPath)) { image in image .resizable() .scaledToFill()