Skip to content

Commit 5d0b90b

Browse files
committed
Added SwiftPM support
1 parent 65084c3 commit 5d0b90b

File tree

6 files changed

+126
-16
lines changed

6 files changed

+126
-16
lines changed

Example/SDWebImageVideoCoder.xcodeproj/xcshareddata/xcschemes/SDWebImageVideoCoder-Example.xcscheme

+9-13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "6003F589195388D20070C39A"
34+
BuildableName = "SDWebImageVideoCoder_Example.app"
35+
BlueprintName = "SDWebImageVideoCoder_Example"
36+
ReferencedContainer = "container:SDWebImageVideoCoder.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "6003F589195388D20070C39A"
46-
BuildableName = "SDWebImageVideoCoder_Example.app"
47-
BlueprintName = "SDWebImageVideoCoder_Example"
48-
ReferencedContainer = "container:SDWebImageVideoCoder.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -71,8 +69,6 @@
7169
ReferencedContainer = "container:SDWebImageVideoCoder.xcodeproj">
7270
</BuildableReference>
7371
</BuildableProductRunnable>
74-
<AdditionalOptions>
75-
</AdditionalOptions>
7672
</LaunchAction>
7773
<ProfileAction
7874
buildConfiguration = "Release"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1220"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES"
14+
codeCoverageEnabled = "YES">
15+
<Testables>
16+
<TestableReference
17+
skipped = "NO">
18+
<BuildableReference
19+
BuildableIdentifier = "primary"
20+
BlueprintIdentifier = "6003F5AD195388D20070C39A"
21+
BuildableName = "SDWebImageVideoCoder_Tests.xctest"
22+
BlueprintName = "SDWebImageVideoCoder_Tests"
23+
ReferencedContainer = "container:SDWebImageVideoCoder.xcodeproj">
24+
</BuildableReference>
25+
</TestableReference>
26+
</Testables>
27+
</TestAction>
28+
<LaunchAction
29+
buildConfiguration = "Debug"
30+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
31+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
32+
launchStyle = "0"
33+
useCustomWorkingDirectory = "NO"
34+
ignoresPersistentStateOnLaunch = "NO"
35+
debugDocumentVersioning = "YES"
36+
debugServiceExtension = "internal"
37+
allowLocationSimulation = "YES">
38+
</LaunchAction>
39+
<ProfileAction
40+
buildConfiguration = "Release"
41+
shouldUseLaunchSchemeArgsEnv = "YES"
42+
savedToolIdentifier = ""
43+
useCustomWorkingDirectory = "NO"
44+
debugDocumentVersioning = "YES">
45+
</ProfileAction>
46+
<AnalyzeAction
47+
buildConfiguration = "Debug">
48+
</AnalyzeAction>
49+
<ArchiveAction
50+
buildConfiguration = "Release"
51+
revealArchiveInOrganizer = "YES">
52+
</ArchiveAction>
53+
</Scheme>

Example/SDWebImageVideoCoder/SDViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ - (void)viewDidLoad
2727
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
2828
[self.view addSubview:self.imageView];
2929

30-
NSURL *gifvURL = [NSURL URLWithString:@"https://imgur.com/download/NL1CXAF/LEGO+my+pizza"];
30+
NSURL *gifvURL = [NSURL URLWithString:@"https://i.imgur.com/FY1AbSo.mp4"];
3131

3232
[self.imageView sd_setImageWithURL:gifvURL completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
3333
if (image) {

Package.resolved

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "SDWebImage",
6+
"repositoryURL": "https://github.com/SDWebImage/SDWebImage.git",
7+
"state": {
8+
"branch": null,
9+
"revision": "a6b6e44eadf0d39250c10a7cc0e3b91d0bdb0e94",
10+
"version": "5.10.4"
11+
}
12+
}
13+
]
14+
},
15+
"version": 1
16+
}

Package.swift

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SDWebImageVideoCoder",
8+
platforms: [
9+
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9)
10+
],
11+
products: [
12+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
13+
.library(
14+
name: "SDWebImageVideoCoder",
15+
targets: ["SDWebImageVideoCoder"]),
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.10.0")
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
25+
.target(
26+
name: "SDWebImageVideoCoder",
27+
dependencies: ["SDWebImage"],
28+
path: ".",
29+
sources: ["SDWebImageVideoCoder/Classes"],
30+
publicHeadersPath: "SDWebImageVideoCoder/Classes"
31+
)
32+
]
33+
)

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ This coder plugin, provide the animation loading support for video format, inclu
2121

2222
## Requirements
2323

24-
+ iOS 8+
25-
+ macOS 10.10+
24+
+ iOS 9+
25+
+ macOS 10.11+
2626
+ tvOS 9+
2727

2828
## Installation
@@ -44,6 +44,18 @@ SDWebImageVideoCoder is available through [Carthage](https://github.com/Carthage
4444
github "SDWebImage/SDWebImageVideoCoder"
4545
```
4646

47+
#### Swift Package Manager (Xcode 11+)
48+
49+
SDWebImageVideoCoder is available through [Swift Package Manager](https://swift.org/package-manager).
50+
51+
```swift
52+
let package = Package(
53+
dependencies: [
54+
.package(url: "https://github.com/SDWebImage/SDWebImageVideoCoder.git", from: "0.2.0")
55+
]
56+
)
57+
```
58+
4759
## Usage
4860

4961
### Load Video URL

0 commit comments

Comments
 (0)