mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
29 lines
1022 B
Swift
29 lines
1022 B
Swift
import Foundation
|
|
import UIKit
|
|
|
|
import LottieMeshSwift
|
|
|
|
public final class ViewController: UIViewController {
|
|
override public func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
self.view.backgroundColor = .black
|
|
|
|
let path = Bundle.main.path(forResource: "Fireworks", ofType: "json")!
|
|
//let path = Bundle.main.path(forResource: "Cat", ofType: "json")!
|
|
/*for _ in 0 ..< 100 {
|
|
let _ = generateMeshAnimation(data: try! Data(contentsOf: URL(fileURLWithPath: path)))!
|
|
}*/
|
|
|
|
if #available(iOS 13.0, *) {
|
|
let animation = generateMeshAnimation(data: try! Data(contentsOf: URL(fileURLWithPath: path)))!
|
|
let renderer = MeshRenderer(wireframe: true)!
|
|
|
|
renderer.frame = CGRect(origin: CGPoint(x: 0.0, y: 50.0), size: CGSize(width: 300.0, height: 300.0))
|
|
self.view.addSubview(renderer)
|
|
|
|
renderer.add(mesh: animation, offset: CGPoint(), loop: true)
|
|
}
|
|
}
|
|
}
|