Latest 2.1.2
Homepage https://github.com/hodinkee/iris
License MIT
Platforms ios 8.0, osx 10.10, tvos 9.0, requires ARC
Authors ,

Build Status
Carthage Compatible
CocoaPods Compatible

A Swift framework for working with Imgix.

Requirements

Xcode Swift iOS tvOS macOS
8.0 3.0 8.0 9.0 10.10

Installation

Carthage

github "hodinkee/Iris" ~> 2.1

CocoaPods

pod "Iris", "~> 2.1"

Usage

Let’s say you have an Imgix Web Folder or Amazon S3 source setup. You then have a plain URL to an image resource like the one below.

let imageURL = NSURL(string: "https://my-source.imgix.net/path/to/my/image")

Now, the original image is a rather large 1920x1080px photo of Yosemite, but your app displays it in a 320x180pt view. It would be incredibly wasteful of bandwidth and memory to download the original image. Let’s fix that by asking Imgix to resize it for us.

let displayScale = imageView.traitCollection.displayScale
let imageOptions = ImageOptions(width: 320, height: 180, scale: displayScale)
let resizedImageURL = imageURL?.imgixURL(imageOptions: imageOptions)

Want to ensure the resized image is in the JPEG file format with a quality of 50? Just configure the options!

imageOptions.format = .JPEG
imageOptions.quality = 50

If you need to sign your Imgix URLs, whether just for security’s sake or because you’re using a Web Proxy Source, there’s a way to do that too!

let signingOptions = SigningOptions(host: "my-source.imgix.net", token: "FOObar123")
let signedImageURL = imageURL?.imgixURL(imageOptions: imageOptions, signingOptions: signingOptions)

Latest podspec

{
    "name": "Iris",
    "version": "2.1.2",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "A Swift framework for working with Imgix.",
    "homepage": "https://github.com/hodinkee/iris",
    "source": {
        "git": "https://github.com/hodinkee/iris.git",
        "tag": "v2.1.2"
    },
    "authors": {
        "Jonathan Baker": "[email protected]",
        "Caleb Davenport": "[email protected]"
    },
    "requires_arc": true,
    "source_files": "Iris/*.{h,m,swift}",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "tvos": "9.0"
    },
    "ios": {
        "frameworks": "UIKit"
    },
    "osx": {
        "frameworks": "Cocoa"
    },
    "tvos": {
        "frameworks": "UIKit"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This