INSImageView 0.1.6

INSImageView 0.1.6

测试已测试
Lang语言 SwiftSwift
许可 MIT
Released最新版本发布2016年9月
SPM支持 SPM

Patrick 维护。



  • Patrick

INSImageView

描述

A UIImageView that allows for animations between UIViewContentModes through the use of UIView block-based animations e.g. UIView.animateWithDuration…

Animation Image

兼容性

使用 Swift 在 iOS8 和 iOS9 上进行了测试

使用方法

let imageView = INSImageView(...)
imageView.contentMode = .ScaleAspectFit

UIView.animateWithDuration(1,
    animations: {
      self.imageView.contentMode = .ScaleAspectFill
    }
)

注意事项

由于 INSImageView 的实现方式,需要将 imagehighlightedImage 属性获取器设置为 NOOP。如果您希望获取原始图片,请分别使用 originalImageoriginalHighlightedImage

let image = imageView.originalImage
let highlightedImage = imageView.originalHighlightedImage

安装

INSImageView 可通过 CocoaPods 获取。要安装它,只需将以下行添加到 Podfile

pod "INSImageView"

待办事项

  • [ ] 测试(包括从代码/Storyboard 创建 INSImageView)

联系

Patrick, [email protected]

许可

INSImageView 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。