2018-08-28 20:44:11 +08:00
|
|
|
# libwebp + Xcode
|
|
|
|
|
|
|
|
A wrapper for [libwebp](https://github.com/webmproject/libwebp) + Xcode project.
|
|
|
|
This enables Carthage support
|
2019-10-06 12:54:08 +08:00
|
|
|
This also contains the Swift Package Manager support
|
2018-08-28 20:44:11 +08:00
|
|
|
|
|
|
|
[![CI Status](http://img.shields.io/travis/SDWebImage/libwebp-Xcode.svg?style=flat)](https://travis-ci.org/SDWebImage/libwebp-Xcode)
|
|
|
|
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/libwebp-Xcode)
|
2019-10-06 12:54:08 +08:00
|
|
|
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)
|
2018-08-28 20:44:11 +08:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
+ iOS 8
|
|
|
|
+ macOS 10.6
|
|
|
|
+ tvOS 9.0
|
|
|
|
+ watchOS 2.0
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2019-12-27 12:14:32 +08:00
|
|
|
#### CocoaPods
|
|
|
|
|
|
|
|
libwebp is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
pod 'libwebp'
|
|
|
|
```
|
|
|
|
|
2019-10-06 12:54:08 +08:00
|
|
|
### Carthage
|
|
|
|
|
2018-08-28 20:44:11 +08:00
|
|
|
libwebp is (via this repo) available through [Carthage](https://github.com/Carthage/Carthage).
|
|
|
|
|
|
|
|
```
|
|
|
|
github "SDWebImage/libwebp-Xcode"
|
|
|
|
```
|
|
|
|
|
2019-10-06 12:54:08 +08:00
|
|
|
### SwiftPM
|
|
|
|
|
|
|
|
Libwebp is available through [Swift Package Manager](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg).
|
|
|
|
|
2019-12-27 12:14:32 +08:00
|
|
|
```swift
|
2019-10-06 12:54:08 +08:00
|
|
|
let package = Package(
|
|
|
|
dependencies: [
|
2019-12-27 11:34:55 +08:00
|
|
|
.package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0")
|
2019-10-06 12:54:08 +08:00
|
|
|
],
|
|
|
|
// ...
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2018-08-28 20:44:11 +08:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Use libwebp as you would normally, this is just a repo that adds an Xcode proj.
|
|
|
|
|
2020-01-07 16:25:25 +08:00
|
|
|
For Swift Package Manager user, it's recommended to use the modular import instead of C headers.
|
2019-10-06 12:54:08 +08:00
|
|
|
|
|
|
|
+ Objective-C
|
|
|
|
|
|
|
|
```objective-c
|
|
|
|
@import libwebp;
|
2020-01-07 16:25:25 +08:00
|
|
|
// or if you don't use module
|
|
|
|
#import <webp/decode.h>
|
|
|
|
#import <webp/encode.h>
|
2019-10-06 12:54:08 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
+ Swift
|
|
|
|
|
|
|
|
```swift
|
|
|
|
import libwebp
|
|
|
|
```
|
|
|
|
|
2018-08-28 20:44:11 +08:00
|
|
|
## License
|
|
|
|
|
|
|
|
libwebp is available under the BSD-3 license. See [the LICENSE file](https://github.com/webmproject/libwebp/blob/master/COPYING) for more info.
|
2019-10-06 12:54:08 +08:00
|
|
|
|
|
|
|
|