Skip to content

Commit cdeb11a

Browse files
authored
Merge pull request #3 from SDWebImage/swiftpm
Added SwiftPM support
2 parents f8dc0f0 + 1a64c35 commit cdeb11a

File tree

6 files changed

+105
-0
lines changed

6 files changed

+105
-0
lines changed

Package.resolved

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: "SDWebImagePINPlugin",
8+
platforms: [
9+
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
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: "SDWebImagePINPlugin",
15+
targets: ["SDWebImagePINPlugin"]),
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+
.package(url: "https://github.com/pinterest/PINCache.git", from: "3.0.2")
22+
],
23+
targets: [
24+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
25+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
26+
.target(
27+
name: "SDWebImagePINPlugin",
28+
dependencies: ["SDWebImage", "PINCache"],
29+
path: ".",
30+
sources: ["SDWebImagePINPlugin/Classes"],
31+
publicHeadersPath: "SDWebImagePINPlugin/Classes"
32+
)
33+
]
34+
)

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![License](https://img.shields.io/cocoapods/l/SDWebImagePINPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePINPlugin)
66
[![Platform](https://img.shields.io/cocoapods/p/SDWebImagePINPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePINPlugin)
77
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImagePINPlugin)
8+
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
89
[![codecov](https://codecov.io/gh/SDWebImage/SDWebImagePINPlugin/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImagePINPlugin)
910

1011

@@ -97,6 +98,18 @@ SDWebImageFLPlugin is available through [Carthage](https://github.com/Carthage/C
9798
github "SDWebImage/SDWebImagePINPlugin"
9899
```
99100

101+
#### Swift Package Manager (Xcode 11+)
102+
103+
SDWebImagePhotosPlugin is available through [Swift Package Manager](https://swift.org/package-manager).
104+
105+
```swift
106+
let package = Package(
107+
dependencies: [
108+
.package(url: "https://github.com/SDWebImage/SDWebImagePINPlugin.git", from: "0.3.0")
109+
]
110+
)
111+
```
112+
100113
## Author
101114

102115
DreamPiggy, [email protected]

SDWebImagePINPlugin/Classes/PINCache+SDAdditions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
*/
77

88

9+
#if __has_include(<PINCache/PINCache.h>)
910
#import <PINCache/PINCache.h>
11+
#else
12+
@import PINCache;
13+
#endif
14+
#if __has_include(<SDWebImage/SDWebImage.h>)
1015
#import <SDWebImage/SDWebImage.h>
16+
#else
17+
@import SDWebImage;
18+
#endif
1119

1220
/// PINCache category to support `SDImageCache` protocol. This allow user who prefer PINCache to be used as SDWebImage's custom image cache
1321
@interface PINCache (SDAdditions) <SDImageCache>

SDWebImagePINPlugin/Classes/PINDiskCache+SDAdditions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
* file that was distributed with this source code.
66
*/
77

8+
#if __has_include(<PINCache/PINCache.h>)
89
#import <PINCache/PINCache.h>
10+
#else
11+
@import PINCache;
12+
#endif
13+
#if __has_include(<SDWebImage/SDWebImage.h>)
914
#import <SDWebImage/SDWebImage.h>
15+
#else
16+
@import SDWebImage;
17+
#endif
1018

1119
/// PINDiskCache category to support `SDDiskCache` protocol. This allow user who prefer PINDiskCache to be used as SDWebImage's custom disk cache
1220
@interface PINDiskCache (SDAdditions) <SDDiskCache>

SDWebImagePINPlugin/Classes/PINMemoryCache+SDAdditions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
* file that was distributed with this source code.
66
*/
77

8+
#if __has_include(<PINCache/PINCache.h>)
89
#import <PINCache/PINCache.h>
10+
#else
11+
@import PINCache;
12+
#endif
13+
#if __has_include(<SDWebImage/SDWebImage.h>)
914
#import <SDWebImage/SDWebImage.h>
15+
#else
16+
@import SDWebImage;
17+
#endif
1018

1119
/// PINMemoryCache category to support `SDMemoryCache` protocol. This allow user who prefer PINMemoryCache to be used as SDWebImage's custom memory cache
1220
@interface PINMemoryCache (SDAdditions) <SDMemoryCache>

0 commit comments

Comments
 (0)