Update README
This is SVG animation presentation kit for iOS.
You can run example app. Please open Example-iOS/Elephant-iOS.xcworkspace!
Example-iOS/Elephant-iOS.xcworkspace
You can display the svg image with animation.
We are supportted two animation formats😎
The format is below.
Usage is difference by the format.
This is initialization SVGView for format 1 (Animation in SVG) usage.
SVGView(named: "svg-filename", animationOwner: .svg)
This is initialization SVGView for format 2 (Animation in CSS) usage.
SVGView(named: "svg-filename", animationOwner: .css, style: .cssFile(name: "css-filename"))
And, you initialized view, you have to do is only add view to parent view, and start animation like below.
class ViewController: UIViewController { let svgView = SVGView(named: "image", animationOwner: .svg) override func viewDidLoad() { super.viewDidLoad() view.addSubview(svgView) svgView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ svgView.centerXAnchor.constraint(equalTo: view.centerXAnchor), svgView.centerYAnchor.constraint(equalTo: view.centerYAnchor), svgView.widthAnchor.constraint(equalToConstant: 400), svgView.heightAnchor.constraint(equalToConstant: 400), ]) svgView.startAnimation() // svgView.stopAnimation() // Stop animation. // svgView.isAnimate { [weak self] (value, error) in // if let error = error { // print(error) // } // guard let value = value else { return } // value means whether animation is moving. // } } }
Add the following to the dependencies of your Package.swift:
dependencies: [ .package(url: "https://github.com/s2mr/Elephant.git", from: "Elephant version"), ]
Add this to Podfile
Podfile
pod 'Elephant'
$ pod install
Add this to Cartfile
Cartfile
github "s2mr/Elephant"
$ carthage update --platform ios
Kazumasa Shimomura
Elephant is available under the Apache v2. See the LICENSE file for more info.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Elephant
This is SVG animation presentation kit for iOS.
Example
You can run example app. Please open
Example-iOS/Elephant-iOS.xcworkspace
!Usage
You can display the svg image with animation.
We are supportted two animation formats😎
The format is below.
Usage is difference by the format.
SVGView initialization
This is initialization SVGView for format 1 (Animation in SVG) usage.
This is initialization SVGView for format 2 (Animation in CSS) usage.
Show in your ViewController
And, you initialized view, you have to do is only add view to parent view, and start animation like below.
Requirements
Installation
Swift package manager
Add the following to the dependencies of your Package.swift:
CocoaPods
Add this to
Podfile
Carthage
Add this to
Cartfile
Author
Kazumasa Shimomura
License
Elephant is available under the Apache v2. See the LICENSE file for more info.