Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adellibovi/swiftui-pathanimations
Tools for SwiftUI that helps perform Path and Shape animations, such us morphing circle or shape transformations
https://github.com/adellibovi/swiftui-pathanimations
swift swiftui swiftui-animations swiftui-example
Last synced: 1 day ago
JSON representation
Tools for SwiftUI that helps perform Path and Shape animations, such us morphing circle or shape transformations
- Host: GitHub
- URL: https://github.com/adellibovi/swiftui-pathanimations
- Owner: adellibovi
- License: mit
- Created: 2019-07-03T21:53:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-13T22:44:55.000Z (about 5 years ago)
- Last Synced: 2024-11-07T20:51:40.234Z (9 days ago)
- Topics: swift, swiftui, swiftui-animations, swiftui-example
- Language: Swift
- Size: 3.06 MB
- Stars: 219
- Watchers: 6
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftUI+PathAnimations 🔵
## Introduction
This packages contains `SimilarShape` and `InterpolatedShape`, both can be used to achieve shapes animations with SwiftUI.
![SwiftUI Morphing Circle Demo](demo.gif)
## How it works?
`SimilarShape` should be used when animating two or more similar paths. A path is similar to another one when having the same number and types of `Path.Element`. I.e.: two rects with different height, width and origin are considered similar, since the two paths are made by the same `Path.Element` but with different `CGPoint`.
`InterpolatedShape` should be used when animating two or more different paths. Internally, it will create a slighlty different path used for animation, by interpolating the original one.
## Example
The attached example (Example/Example.xcodeproj) is using:
* `SimilarShape` to perform the drag animation of the morphing circle 🔵, since the `Path` create starting from the original circle and the one create with the dragging point are essentially the same
* `InterpolatedShape` to perform the animated trasformation from a circle and a rounded rectangle, being very different paths.## Author
Feel free to reach me out at [@adellibovi](https://twitter.com/adellibovi)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details