PBImageView 1.0.4

PBImageView 1.0.4

测试已测试
Lang语言 SwiftSwift
许可证 MIT
Released最后发布2020年2月
SPM支持 SPM

Patrick 维护。



  • 作者
  • patrickbdev

PBImageView

Version License Platform

一种 UIImageView 的替代品,允许在 contentModes 之间进行动画切换。

Sample Animation

使用方法

PBImageView 的 API 完全与 UIImageView 相同。要动画化内容模式,只需将其包裹在一个 UIView 动画块中即可。

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

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

Storyboard 使用

PBImageView 继承自 UIView,而不是 UIImageView。要使用它,在 storyboard 中放置一个UIView,并将 ClassModule 设置为 PBImageView

Storyboard Class/Module

示例

要运行示例项目,请克隆仓库,然后从 Example 目录中首先运行 pod install

需求

  • iOS 8
  • Swift 3.0

安装

PBImageView可以通过CocoaPods获取。要安装它,请在Podfile中添加以下行

pod "PBImageView"

作者

patrickbdev, [email protected]

许可

PBImageView遵循MIT许可。请查看LICENSE文件以获取更多信息。