Skip to content

Commit 2909b00

Browse files
committed
Drop iOS 13/macOS 10.15/tvOS 13/watchOS 6 support
Changes: 1. Backport sources are removed 2. Availability is changed 3. Use StateObject instead
1 parent ed28866 commit 2909b00

20 files changed

+96
-535
lines changed

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.3
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "SDWebImageSwiftUI",
88
platforms: [
9-
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)
9+
.macOS(.v11), .iOS(.v14), .tvOS(.v14), .watchOS(.v7)
1010
],
1111
products: [
1212
// Products define the executables and libraries produced by a package, and make them visible to other packages.

README.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ All issue reports, feature requests, contributions, and GitHub stars are welcome
5151
## Requirements
5252

5353
+ Xcode 12+
54-
+ iOS 13+ (14+ Recommended)
55-
+ macOS 10.15+ (11+ Recommended)
56-
+ tvOS 13+ (14+ Recommended)
57-
+ watchOS 6+ (7+ Recommended)
54+
+ iOS 14+
55+
+ macOS 11+
56+
+ tvOS 14+
57+
+ watchOS 7+
5858

5959
## SwiftUI 2.0 Compatibility
6060

@@ -74,9 +74,7 @@ var body: some View {
7474
}
7575
```
7676

77-
Note: However, many differences behavior between iOS 13/14's is hard to fixup. And we may break some APIs (which are not designed to be public) to fixup it.
78-
79-
Due to maintain issue, in the future release, we will drop the iOS 13 supports and always match SwiftUI 2.0's behavior. And **v2.x** may be the last version support iOS 13.
77+
Note: However, many differences behavior between iOS 13/14 is hard to fixup. Due to maintain issue, from SDWebImageSwiftUI v3.0, iOS 13 is no longer supported. We always match SwiftUI 2.0's behavior.
8078

8179

8280
## Installation
@@ -514,7 +512,7 @@ For caches, you actually don't need to worry about anything. It just works after
514512

515513
#### Using for backward deployment and weak linking SwiftUI
516514

517-
SDWebImageSwiftUI supports to use when your App Target has a deployment target version less than iOS 13/macOS 10.15/tvOS 13/watchOS 6. Which will weak linking of SwiftUI(Combine) to allows writing code with available check at runtime.
515+
SDWebImageSwiftUI supports to use when your App Target has a deployment target version less than iOS 14/macOS 11/tvOS 14/watchOS 7. Which will weak linking of SwiftUI(Combine) to allows writing code with available check at runtime.
518516

519517
To use backward deployment, you have to do the follow things:
520518

@@ -528,7 +526,7 @@ You should notice that all the third party SwiftUI frameworks should have this b
528526

529527
For deployment target version below iOS 12.2 (The first version which Swift 5 Runtime bundled in iOS system), you have to change the min deployment target version of SDWebImageSwiftUI. This may take some side effect on compiler's optimization and trigger massive warnings for some frameworks.
530528

531-
However, for iOS 12.2+, you can still keep the min deployment target version to iOS 13, no extra warnings or performance slow down for iOS 13 client.
529+
However, for iOS 12.2+, you can still keep the min deployment target version to iOS 14, no extra warnings or performance slow down for iOS 14 client.
532530

533531
Because Swift use the min deployment target version to detect whether to link the App bundled Swift runtime, or the System built-in one (`/usr/lib/swift/libswiftCore.dylib`).
534532

@@ -555,7 +553,7 @@ end
555553
+ For CocoaPods user, you can skip the platform version validation in Podfile with:
556554

557555
```ruby
558-
platform :ios, '13.0' # This does not effect your App Target's deployment target version, just a hint for CocoaPods
556+
platform :ios, '14.0' # This does not effect your App Target's deployment target version, just a hint for CocoaPods
559557
```
560558

561559
+ For SwiftPM user, SwiftPM does not support weak linking nor Library Evolution, so it can not deployment to iOS 12+ user without changing the min deployment target.
@@ -568,7 +566,7 @@ Add **all the SwiftUI code** with the available annotation and runtime check, li
568566
// AppDelegate.swift
569567
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
570568
// ...
571-
if #available(iOS 13, *) {
569+
if #available(iOS 14, *) {
572570
window.rootViewController = UIHostingController(rootView: ContentView())
573571
} else {
574572
window.rootViewController = ViewController()
@@ -590,11 +588,11 @@ class ViewController: UIViewController {
590588
}
591589

592590
// ContentView.swift
593-
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
591+
@available(iOS 14.0, OSX 11.0, tvOS 14.0, watchOS 7.0, *)
594592
struct ContentView : View {
595593
var body: some View {
596594
Group {
597-
Text("Hello World iOS 13!")
595+
Text("Hello World iOS 14!")
598596
WebImage(url: URL(string: "https://i.loli.net/2019/09/24/rX2RkVWeGKIuJvc.jpg"))
599597
}
600598
}

SDWebImageSwiftUI.podspec

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ It brings all your favorite features from SDWebImage, like async image loading,
2121
s.author = { 'DreamPiggy' => 'lizhuoli1126@126.com' }
2222
s.source = { :git => 'https://github.com/SDWebImage/SDWebImageSwiftUI.git', :tag => s.version.to_s }
2323

24-
s.ios.deployment_target = '13.0'
25-
s.osx.deployment_target = '10.15'
26-
s.tvos.deployment_target = '13.0'
27-
s.watchos.deployment_target = '6.0'
24+
s.ios.deployment_target = '14.0'
25+
s.osx.deployment_target = '11.0'
26+
s.tvos.deployment_target = '14.0'
27+
s.watchos.deployment_target = '7.0'
2828

2929
s.source_files = 'SDWebImageSwiftUI/Classes/**/*', 'SDWebImageSwiftUI/Module/*.h'
3030
s.pod_target_xcconfig = {
@@ -35,5 +35,5 @@ It brings all your favorite features from SDWebImage, like async image loading,
3535

3636
s.weak_frameworks = 'SwiftUI', 'Combine'
3737
s.dependency 'SDWebImage', '~> 5.10'
38-
s.swift_version = '5.2'
38+
s.swift_version = '5.3'
3939
end

SDWebImageSwiftUI.xcodeproj/project.pbxproj

+8-58
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,6 @@
3131
32B933E623659A1900BB7CAD /* Transition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B933E423659A1900BB7CAD /* Transition.swift */; };
3232
32B933E723659A1900BB7CAD /* Transition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B933E423659A1900BB7CAD /* Transition.swift */; };
3333
32B933E823659A1900BB7CAD /* Transition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B933E423659A1900BB7CAD /* Transition.swift */; };
34-
32BC087328D23D35002451BD /* StateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC086F28D23D35002451BD /* StateObject.swift */; };
35-
32BC087428D23D35002451BD /* StateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC086F28D23D35002451BD /* StateObject.swift */; };
36-
32BC087528D23D35002451BD /* StateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC086F28D23D35002451BD /* StateObject.swift */; };
37-
32BC087628D23D35002451BD /* StateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC086F28D23D35002451BD /* StateObject.swift */; };
38-
32BC087728D23D35002451BD /* OnChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087028D23D35002451BD /* OnChange.swift */; };
39-
32BC087828D23D35002451BD /* OnChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087028D23D35002451BD /* OnChange.swift */; };
40-
32BC087928D23D35002451BD /* OnChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087028D23D35002451BD /* OnChange.swift */; };
41-
32BC087A28D23D35002451BD /* OnChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087028D23D35002451BD /* OnChange.swift */; };
42-
32BC087B28D23D35002451BD /* Overlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087128D23D35002451BD /* Overlay.swift */; };
43-
32BC087C28D23D35002451BD /* Overlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087128D23D35002451BD /* Overlay.swift */; };
44-
32BC087D28D23D35002451BD /* Overlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087128D23D35002451BD /* Overlay.swift */; };
45-
32BC087E28D23D35002451BD /* Overlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087128D23D35002451BD /* Overlay.swift */; };
46-
32BC087F28D23D35002451BD /* Backport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087228D23D35002451BD /* Backport.swift */; };
47-
32BC088028D23D35002451BD /* Backport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087228D23D35002451BD /* Backport.swift */; };
48-
32BC088128D23D35002451BD /* Backport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087228D23D35002451BD /* Backport.swift */; };
49-
32BC088228D23D35002451BD /* Backport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BC087228D23D35002451BD /* Backport.swift */; };
5034
32C43DE622FD54CD00BE87F5 /* SDWebImageSwiftUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 32C43DE422FD54CD00BE87F5 /* SDWebImageSwiftUI.h */; settings = {ATTRIBUTES = (Public, ); }; };
5135
32C43DEA22FD577300BE87F5 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32C43DE922FD577300BE87F5 /* SDWebImage.framework */; };
5236
32C43E1622FD583700BE87F5 /* ImageManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C43DDC22FD54C600BE87F5 /* ImageManager.swift */; };
@@ -93,10 +77,6 @@
9377
326E480923431C0F00C633E9 /* ImageViewWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewWrapper.swift; sourceTree = "<group>"; };
9478
32B79C9428DB40430088C432 /* SwiftUICompatibility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUICompatibility.swift; sourceTree = "<group>"; };
9579
32B933E423659A1900BB7CAD /* Transition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Transition.swift; sourceTree = "<group>"; };
96-
32BC086F28D23D35002451BD /* StateObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateObject.swift; sourceTree = "<group>"; };
97-
32BC087028D23D35002451BD /* OnChange.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnChange.swift; sourceTree = "<group>"; };
98-
32BC087128D23D35002451BD /* Overlay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Overlay.swift; sourceTree = "<group>"; };
99-
32BC087228D23D35002451BD /* Backport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Backport.swift; sourceTree = "<group>"; };
10080
32BD9C4623E03B08008D5F6A /* IndicatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorTests.swift; sourceTree = "<group>"; };
10181
32C43DCC22FD540D00BE87F5 /* SDWebImageSwiftUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImageSwiftUI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
10282
32C43DDC22FD54C600BE87F5 /* ImageManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageManager.swift; sourceTree = "<group>"; };
@@ -185,17 +165,6 @@
185165
path = Transition;
186166
sourceTree = "<group>";
187167
};
188-
32BC086E28D23D35002451BD /* Backports */ = {
189-
isa = PBXGroup;
190-
children = (
191-
32BC086F28D23D35002451BD /* StateObject.swift */,
192-
32BC087028D23D35002451BD /* OnChange.swift */,
193-
32BC087128D23D35002451BD /* Overlay.swift */,
194-
32BC087228D23D35002451BD /* Backport.swift */,
195-
);
196-
path = Backports;
197-
sourceTree = "<group>";
198-
};
199168
32C43DC222FD540D00BE87F5 = {
200169
isa = PBXGroup;
201170
children = (
@@ -232,7 +201,6 @@
232201
children = (
233202
32B933E323659A0700BB7CAD /* Transition */,
234203
326099472362E09E006EBB22 /* Indicator */,
235-
32BC086E28D23D35002451BD /* Backports */,
236204
32C43DDC22FD54C600BE87F5 /* ImageManager.swift */,
237205
32CBA77E25E4D7D800C6A8DC /* ImagePlayer.swift */,
238206
32C43DDE22FD54C600BE87F5 /* WebImage.swift */,
@@ -453,11 +421,8 @@
453421
isa = PBXSourcesBuildPhase;
454422
buildActionMask = 2147483647;
455423
files = (
456-
32BC087328D23D35002451BD /* StateObject.swift in Sources */,
457-
32BC087728D23D35002451BD /* OnChange.swift in Sources */,
458424
32B933E523659A1900BB7CAD /* Transition.swift in Sources */,
459425
32CBA78025E4D7D800C6A8DC /* ImagePlayer.swift in Sources */,
460-
32BC087B28D23D35002451BD /* Overlay.swift in Sources */,
461426
32C43E1722FD583700BE87F5 /* WebImage.swift in Sources */,
462427
326B848C236335400011BDFB /* ProgressIndicator.swift in Sources */,
463428
326B84822363350C0011BDFB /* Indicator.swift in Sources */,
@@ -468,19 +433,15 @@
468433
32C43E1622FD583700BE87F5 /* ImageManager.swift in Sources */,
469434
32C43E1822FD583700BE87F5 /* AnimatedImage.swift in Sources */,
470435
32D26A022446B546005905DA /* Image.swift in Sources */,
471-
32BC087F28D23D35002451BD /* Backport.swift in Sources */,
472436
);
473437
runOnlyForDeploymentPostprocessing = 0;
474438
};
475439
32C43DF022FD57FD00BE87F5 /* Sources */ = {
476440
isa = PBXSourcesBuildPhase;
477441
buildActionMask = 2147483647;
478442
files = (
479-
32BC087428D23D35002451BD /* StateObject.swift in Sources */,
480-
32BC087828D23D35002451BD /* OnChange.swift in Sources */,
481443
32B933E623659A1900BB7CAD /* Transition.swift in Sources */,
482444
32CBA78125E4D7D800C6A8DC /* ImagePlayer.swift in Sources */,
483-
32BC087C28D23D35002451BD /* Overlay.swift in Sources */,
484445
32C43E1A22FD583700BE87F5 /* WebImage.swift in Sources */,
485446
326B848D236335400011BDFB /* ProgressIndicator.swift in Sources */,
486447
326B84832363350C0011BDFB /* Indicator.swift in Sources */,
@@ -491,19 +452,15 @@
491452
32C43E1922FD583700BE87F5 /* ImageManager.swift in Sources */,
492453
32C43E1B22FD583700BE87F5 /* AnimatedImage.swift in Sources */,
493454
32D26A032446B546005905DA /* Image.swift in Sources */,
494-
32BC088028D23D35002451BD /* Backport.swift in Sources */,
495455
);
496456
runOnlyForDeploymentPostprocessing = 0;
497457
};
498458
32C43DFD22FD581400BE87F5 /* Sources */ = {
499459
isa = PBXSourcesBuildPhase;
500460
buildActionMask = 2147483647;
501461
files = (
502-
32BC087528D23D35002451BD /* StateObject.swift in Sources */,
503-
32BC087928D23D35002451BD /* OnChange.swift in Sources */,
504462
32B933E723659A1900BB7CAD /* Transition.swift in Sources */,
505463
32CBA78225E4D7D800C6A8DC /* ImagePlayer.swift in Sources */,
506-
32BC087D28D23D35002451BD /* Overlay.swift in Sources */,
507464
32C43E1D22FD583800BE87F5 /* WebImage.swift in Sources */,
508465
326B848E236335400011BDFB /* ProgressIndicator.swift in Sources */,
509466
326B84842363350C0011BDFB /* Indicator.swift in Sources */,
@@ -514,19 +471,15 @@
514471
32C43E1C22FD583800BE87F5 /* ImageManager.swift in Sources */,
515472
32C43E1E22FD583800BE87F5 /* AnimatedImage.swift in Sources */,
516473
32D26A042446B546005905DA /* Image.swift in Sources */,
517-
32BC088128D23D35002451BD /* Backport.swift in Sources */,
518474
);
519475
runOnlyForDeploymentPostprocessing = 0;
520476
};
521477
32C43E0A22FD581C00BE87F5 /* Sources */ = {
522478
isa = PBXSourcesBuildPhase;
523479
buildActionMask = 2147483647;
524480
files = (
525-
32BC087628D23D35002451BD /* StateObject.swift in Sources */,
526-
32BC087A28D23D35002451BD /* OnChange.swift in Sources */,
527481
32B933E823659A1900BB7CAD /* Transition.swift in Sources */,
528482
32CBA78325E4D7D800C6A8DC /* ImagePlayer.swift in Sources */,
529-
32BC087E28D23D35002451BD /* Overlay.swift in Sources */,
530483
32C43E2022FD583800BE87F5 /* WebImage.swift in Sources */,
531484
326B848F236335400011BDFB /* ProgressIndicator.swift in Sources */,
532485
326B84852363350C0011BDFB /* Indicator.swift in Sources */,
@@ -537,7 +490,6 @@
537490
32C43E1F22FD583800BE87F5 /* ImageManager.swift in Sources */,
538491
32C43E2122FD583800BE87F5 /* AnimatedImage.swift in Sources */,
539492
32D26A052446B546005905DA /* Image.swift in Sources */,
540-
32BC088228D23D35002451BD /* Backport.swift in Sources */,
541493
);
542494
runOnlyForDeploymentPostprocessing = 0;
543495
};
@@ -596,8 +548,8 @@
596548
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
597549
GCC_WARN_UNUSED_FUNCTION = YES;
598550
GCC_WARN_UNUSED_VARIABLE = YES;
599-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
600-
MACOSX_DEPLOYMENT_TARGET = 10.15;
551+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
552+
MACOSX_DEPLOYMENT_TARGET = 11.0;
601553
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
602554
MTL_FAST_MATH = YES;
603555
ONLY_ACTIVE_ARCH = YES;
@@ -610,10 +562,10 @@
610562
SDKROOT = iphoneos;
611563
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
612564
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
613-
TVOS_DEPLOYMENT_TARGET = 13.0;
565+
TVOS_DEPLOYMENT_TARGET = 14.0;
614566
VERSIONING_SYSTEM = "apple-generic";
615567
VERSION_INFO_PREFIX = "";
616-
WATCHOS_DEPLOYMENT_TARGET = 6.0;
568+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
617569
};
618570
name = Debug;
619571
};
@@ -663,8 +615,8 @@
663615
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
664616
GCC_WARN_UNUSED_FUNCTION = YES;
665617
GCC_WARN_UNUSED_VARIABLE = YES;
666-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
667-
MACOSX_DEPLOYMENT_TARGET = 10.15;
618+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
619+
MACOSX_DEPLOYMENT_TARGET = 11.0;
668620
MTL_ENABLE_DEBUG_INFO = NO;
669621
MTL_FAST_MATH = YES;
670622
OTHER_LDFLAGS = (
@@ -676,11 +628,11 @@
676628
SDKROOT = iphoneos;
677629
SWIFT_COMPILATION_MODE = wholemodule;
678630
SWIFT_OPTIMIZATION_LEVEL = "-O";
679-
TVOS_DEPLOYMENT_TARGET = 13.0;
631+
TVOS_DEPLOYMENT_TARGET = 14.0;
680632
VALIDATE_PRODUCT = YES;
681633
VERSIONING_SYSTEM = "apple-generic";
682634
VERSION_INFO_PREFIX = "";
683-
WATCHOS_DEPLOYMENT_TARGET = 6.0;
635+
WATCHOS_DEPLOYMENT_TARGET = 7.0;
684636
};
685637
name = Release;
686638
};
@@ -764,7 +716,6 @@
764716
"@executable_path/../Frameworks",
765717
"@loader_path/Frameworks",
766718
);
767-
MACOSX_DEPLOYMENT_TARGET = 10.15;
768719
PRODUCT_BUNDLE_IDENTIFIER = "com.dreampiggy.SDWebImageSwiftUI-macOS";
769720
PRODUCT_NAME = SDWebImageSwiftUI;
770721
SDKROOT = macosx;
@@ -795,7 +746,6 @@
795746
"@executable_path/../Frameworks",
796747
"@loader_path/Frameworks",
797748
);
798-
MACOSX_DEPLOYMENT_TARGET = 10.15;
799749
PRODUCT_BUNDLE_IDENTIFIER = "com.dreampiggy.SDWebImageSwiftUI-macOS";
800750
PRODUCT_NAME = SDWebImageSwiftUI;
801751
SDKROOT = macosx;

0 commit comments

Comments
 (0)