YZEmitterLayer 0.1.2

YZEmitterLayer 0.1.2

qyizhong 维护。



  • qyz777

YZEmitterLayer

License

示例

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

需求

Swift 4.0+

安装

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

pod 'YZEmitterLayer'

使用

import YZEmitterLayer

let tap = UITapGestureRecognizer.init(target: self, action: #selector(begin))
view.addGestureRecognizer(tap)

@objc func begin() {
        let animationLayer = YZEmitterLayer.emitterLayer(size: CGSize.init(width: 32, height: 32), center: view.center, image: UIImage.init(named: "love")!)
        animationLayer.yz_delegate = self
        animationLayer.fromAlpha = 1.0
        animationLayer.toAlpha = 0
        animationLayer.fromScale = 0
        animationLayer.toScale = 1
        animationLayer.roateRange = Double.pi / 4
        animationLayer.startAnimation()
}

作者

qyz777, [email protected]

许可证

YZEmitterLayer遵循MIT许可证。更多信息请参阅LICENSE文件。