它简单地提供了带有枚举类型(左/右/上/下/淡出)的视图动画。
您可以通过协议使用自定义视图简单地使用它。(但是,建议使用清晰的背景色。)
要运行示例项目,请克隆仓库,然后首先从示例目录运行 pod install
。
appetize.io 演示:[这里](https://appetize.io/embed/ffwrpj5nttjrfcna4f1606w02m?device=iphone5s&scale=75&orientation=portrait&osVersion=9.3)
使用 ViewAnimationable 协议创建自定义视图。
class XxxxImageView: UIImageView, ViewAnimationable {
/* required protocl variable. */
public var type:ViewAnimationType = .up
/* use executeAnimation methods when you need. */
public func startXxxxAnimation() {
executeAnimation {
/* do something. between animation. */
// in this sample, need to change image.
}
}
}
PGViewAnimationable 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "PGViewAnimationable"
ipagong,[防护邮箱](/cdn-cgi/l/email-protection#eb829b8a8c84858cc58f8e9dab8c868a8287c5888486)
PGViewAnimationable 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。