Skip to content

Commit 067fb2d

Browse files
committed
Update the readme about Swift Package Manager
1 parent aae84ba commit 067fb2d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
A wrapper for [libwebp](https://github.com/webmproject/libwebp) + Xcode project.
44
This enables Carthage support
5+
This also contains the Swift Package Manager support
56

67
[![CI Status](http://img.shields.io/travis/SDWebImage/libwebp-Xcode.svg?style=flat)](https://travis-ci.org/SDWebImage/libwebp-Xcode)
78
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/libwebp-Xcode)
9+
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)
810

911
## Requirements
1012

@@ -15,16 +17,47 @@ This enables Carthage support
1517

1618
## Installation
1719

20+
### Carthage
21+
1822
libwebp is (via this repo) available through [Carthage](https://github.com/Carthage/Carthage).
1923

2024
```
2125
github "SDWebImage/libwebp-Xcode"
2226
```
2327

28+
### SwiftPM
29+
30+
Libwebp is available through [Swift Package Manager](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg).
31+
32+
```
33+
let package = Package(
34+
dependencies: [
35+
.package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.0.4")
36+
],
37+
// ...
38+
)
39+
```
40+
2441
## Usage
2542

2643
Use libwebp as you would normally, this is just a repo that adds an Xcode proj.
2744

45+
For Swift Package Manager user, use the modular import instead of C headers.
46+
47+
+ Objective-C
48+
49+
```objective-c
50+
@import libwebp;
51+
```
52+
53+
+ Swift
54+
55+
```swift
56+
import libwebp
57+
```
58+
2859
## License
2960

3061
libwebp is available under the BSD-3 license. See [the LICENSE file](https://github.com/webmproject/libwebp/blob/master/COPYING) for more info.
62+
63+

0 commit comments

Comments
 (0)