Skip to content

Added SwiftPM support #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2021
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
34 changes: 34 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "SDWebImagePINPlugin",
platforms: [
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SDWebImagePINPlugin",
targets: ["SDWebImagePINPlugin"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.10.0"),
.package(url: "https://github.com/pinterest/PINCache.git", from: "3.0.2")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SDWebImagePINPlugin",
dependencies: ["SDWebImage", "PINCache"],
path: ".",
sources: ["SDWebImagePINPlugin/Classes"],
publicHeadersPath: "SDWebImagePINPlugin/Classes"
)
]
)
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![License](https://img.shields.io/cocoapods/l/SDWebImagePINPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePINPlugin)
[![Platform](https://img.shields.io/cocoapods/p/SDWebImagePINPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePINPlugin)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImagePINPlugin)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
[![codecov](https://codecov.io/gh/SDWebImage/SDWebImagePINPlugin/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImagePINPlugin)


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

#### Swift Package Manager (Xcode 11+)

SDWebImagePhotosPlugin is available through [Swift Package Manager](https://swift.org/package-manager).

```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SDWebImage/SDWebImagePINPlugin.git", from: "0.3.0")
]
)
```

## Author

DreamPiggy, [email protected]
Expand Down
8 changes: 8 additions & 0 deletions SDWebImagePINPlugin/Classes/PINCache+SDAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
*/


#if __has_include(<PINCache/PINCache.h>)
#import <PINCache/PINCache.h>
#else
@import PINCache;
#endif
#if __has_include(<SDWebImage/SDWebImage.h>)
#import <SDWebImage/SDWebImage.h>
#else
@import SDWebImage;
#endif

/// PINCache category to support `SDImageCache` protocol. This allow user who prefer PINCache to be used as SDWebImage's custom image cache
@interface PINCache (SDAdditions) <SDImageCache>
Expand Down
8 changes: 8 additions & 0 deletions SDWebImagePINPlugin/Classes/PINDiskCache+SDAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
* file that was distributed with this source code.
*/

#if __has_include(<PINCache/PINCache.h>)
#import <PINCache/PINCache.h>
#else
@import PINCache;
#endif
#if __has_include(<SDWebImage/SDWebImage.h>)
#import <SDWebImage/SDWebImage.h>
#else
@import SDWebImage;
#endif

/// PINDiskCache category to support `SDDiskCache` protocol. This allow user who prefer PINDiskCache to be used as SDWebImage's custom disk cache
@interface PINDiskCache (SDAdditions) <SDDiskCache>
Expand Down
8 changes: 8 additions & 0 deletions SDWebImagePINPlugin/Classes/PINMemoryCache+SDAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
* file that was distributed with this source code.
*/

#if __has_include(<PINCache/PINCache.h>)
#import <PINCache/PINCache.h>
#else
@import PINCache;
#endif
#if __has_include(<SDWebImage/SDWebImage.h>)
#import <SDWebImage/SDWebImage.h>
#else
@import SDWebImage;
#endif

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