Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.55 KB

README.md

File metadata and controls

51 lines (32 loc) · 1.55 KB

PBImageView

Version License Platform

A UIImageView alternative that allows for animations between contentModes.

Sample Animation

Usage

The API for PBImageView is exactly the same as a UIImageView. To animate the contentMode just wrap it in a UIView animation block.

let imageView = PBImageView(image: UIImage(named: "pineapple"))
imageView.contentMode = .scaleAspectFill

UIView.animate(withDuration: 1) {
    imageView.contentMode = .scaleAspectFit
}

Storyboard Use

PBImageView subclasses UIView, not UIImageView. To use it in a storyboard place a UIView and set the Class and Module to PBImageView

Storyboard Class/Module

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8
  • Swift 3.0

Installation

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

pod "PBImageView"

License

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