Nuke-Toucan-Plugin 0.3

Nuke-Toucan-Plugin 0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Feb 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by kean.



 
Depends on:
Nuke~> 5.0
Toucan>= 0.6
 

Nuke Toucan Plugin

Toucan plugin for Nuke that provides a simple API for processing images. It supports resizing, cropping, rounded rect masking and more.

Usage

The plugin adds two methods in an extension of Nuke.Request which let you easily use first-class Toucan API to process your image:

var request = Nuke.Request(url: url)
request.process(key: "Avatar") {
    return $0.resize(CGSize(width: 500, height: 500), fitMode: .crop)
             .maskWithEllipse()
}

And a non-mutating method:

let request = Nuke.Request(url: url).processed(key: "Avatar") { 
    return $0.resize(CGSize(width: 500, height: 500), fitMode: .crop)
             .maskWithEllipse()
}

A key which you provide in the request is used to compare image processors. Equivalent image processors should have the same key. Sometimes a simple string like “Avatar” will do.

Naturally you can add your own extensions to Nuke.Request to describe common operations.

Requirements

  • iOS 9 / tvOS 9
  • Xcode 8
  • Swift 3

Dependencies

License

Nuke is available under the MIT license. See the LICENSE file for more info.