Latest 0.2.8
Homepage https://github.com/calmcom/KenBurns
License MIT
Platforms ios 8.0, tvos 9.0
Dependencies CalmParametricAnimations, SDWebImage
Frameworks UIKit
Authors

Ken Burns

burns

A simple yet configurable Ken Burns effect using a single image looping over itself. Really draws the user’s attention, much more so than a static image.

Usage

KenBurns is written in Swift, but you can use KenBurnsImageView from Swift or Objective-C. Examples are in Swift 3.0:

func newKenBurnsImageView(url: URL) -> KenBurnsImageView {
    let ken = KenBurnsImageView()
    ken.fetchImage(url: url, placeholder: UIImage(named: "placeholder"))
    ken.startAnimating()
    return ken
}

func stop(ken: KenBurnsImageView) {
    ken.stopAnimating()
}

func pause(ken: KenBurnsImageView) {
    ken.pause()
}

func resume(ken: KenBurnsImageView) {
    ken.resume()
}

You can also initialize with a direct UIImage rather than a URL, and there are some paramaters you can set to configure the appearance:

func newKenBurnsImageView(image: UIImage) -> KenBurnsImageView {
    let ken = KenBurnsImageView()
    ken.setImage(image: image)
    ken.zoomIntensity = 1.5
    ken.setDuration(min: 5, max: 13)
    ken.startAnimating()
    return ken
}

Ken Burns has been powering Calm’s nature scenes and meditations since 2016. We found that adding this effect in place of a static image improves click-through rates (and users love it).

Due to unfortunate circumstances, Calm has no direct affiliation with Ken Burns himself 😞

Installation

KenBurns is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KenBurns"

Latest podspec

{
    "name": "KenBurns",
    "version": "0.2.8",
    "summary": "A little Swift tool that performs a nice Ken Burns effect on an image",
    "description": "A little Swift tool that performs a nice Ken Burns effect on an image. Powering Calm since 2016",
    "homepage": "https://github.com/calmcom/KenBurns",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "calmcom": "[email protected]"
    },
    "source": {
        "git": "https://github.com/calmcom/KenBurns.git",
        "tag": "0.2.8"
    },
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    },
    "source_files": "KenBurns/Classes/**/*",
    "frameworks": "UIKit",
    "dependencies": {
        "CalmParametricAnimations": [
            "~> 1.0.1"
        ],
        "SDWebImage": [
            "~> 3.8.2"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This