FlyingViewsAnimation 1.0.0

FlyingViewsAnimation 1.0.0

Bohdan 维护。



  • IDAP 团队

FlyingViewsAnimation

描述

FlyingViewsAnimation 是一个可自定义的视图,可以让您通过在整个背景中随机分布的连续飞行视图流来装饰您的 iOS 应用程序。

RPReplay_Final1711058987.mov

在 UIKit 中的用法示例

以下是 FlyingViewsAnimation 视图最基本的使用和定制的示例。

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let animatedView = AnimatedView()
        animatedView.set(item: { UIImageView(image: UIImage(systemName: "sparkle")) })
        animatedView.set(colors: [.cyan,.blue,.gray])
        animatedView.set(angle: 60)
        animatedView.setItem(size: 30)
        animatedView.frame = self.view.bounds

        self.view.addSubview(animatedView)
        
        animatedView.start()
    }
}

要停止动画并消失所有移动的视图,请调用

animatedView.stop()

要求

iOS 15+,Swift 5.5

安装

FlyingViewsAnimation 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile

pod "FlyingViewsAnimation"

许可证

FlyingViewsAnimation 在 BSD-3 许可证下提供。有关详细信息,请参阅 LICENSE 文件。