Skip to content

A UIImageView alternative that allows for animations between contentModes.

License

Notifications You must be signed in to change notification settings

ptrkstr/PBImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A UIImageView alternative that allows for animations between contentModes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published