Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Zaprogramiacz/MGFlipView
MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.
https://github.com/Zaprogramiacz/MGFlipView
flip flipcard flipping-cards flippingcard flipview ios macos swift swift-package-manager swift5-3 swiftui tvos watchos
Last synced: 2 months ago
JSON representation
MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.
- Host: GitHub
- URL: https://github.com/Zaprogramiacz/MGFlipView
- Owner: Zaprogramiacz
- License: mit
- Created: 2020-10-04T15:22:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-18T16:56:35.000Z (about 4 years ago)
- Last Synced: 2024-08-02T09:27:05.944Z (5 months ago)
- Topics: flip, flipcard, flipping-cards, flippingcard, flipview, ios, macos, swift, swift-package-manager, swift5-3, swiftui, tvos, watchos
- Language: Swift
- Homepage:
- Size: 3.43 MB
- Stars: 65
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui - Zaprogramiacz/MGFlipView - MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic. (Samples)
- fucking-about-SwiftUI - MGFlipView
README
# MGFlipView
![Swift](https://img.shields.io/badge/Swift-5.3-orange)
![Platforms](https://img.shields.io/badge/Platform-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS-blue)
![Dependency manager](https://img.shields.io/badge/Dependency%20manager-SPM-green)## About
If you are looking for an easy way of implement 3D flipping view, you are in the right place. MGFlipView allows to create flipping view in easy way without worring about flipping animation and flipping logic.
The library is written in SwiftUI and it can be used on all platforms (iOS, macOS, watchOS, tvOS).
Examples of usage for all platforms are available after opening `MGFlipView.xcworkspace`.
The library is distributed via SPM.
## Preview
![Preview](Examples/flip_view_example.gif)
## Documentation
`FlipView` takes 6 arguments:
| Argument | Type | Description |
| --------- |:----------------------:| ------------ |
| frontView | `() -> View` | Front view builder. Visible if flipped == true. |
| backView | `() -> View` | Back view builder. Visible if flipped == false. |
| flipped | `Binding` | Binding which gives possiblity to flip the view. |
| flipAxis | `FlipAxis` | Rotation axis. `FlipAxis` have 4 defined values(`x`, `y`, `xy`, `custom(x: Double, y: Double)`). The custom value gives possiblity to declare your own axis. It has `x` default value when argument is not passed to the FlipView initializer. |
| perspective | `CGFloat` | The relative vanishing point. It has 0.5 default value when argument is not passed to the FlipView initializer. |
| animation | `AnimationDescription` | Defines the animation that takes place when flipping. Animation can be customized by setting duration and timing function (`linear`, `easeIn`, `easeOut`, `easeInOut`). It has `.init(type: .linear, duration: 0.25)` default value when argument is not passed to the FlipView initializer. |```swift
public init(@ViewBuilder frontView: @escaping () -> ContentFront,
@ViewBuilder backView: @escaping () -> ContentBack,
flipped: Binding,
flipAxis: FlipAxis = .x,
perspective: CGFloat = 0.5,
animation: AnimationDescription = .default)
```## Installation
Use `https://github.com/Zaprogramiacz/MGFlipView.git` link to add Swift Package to Xcode project
## License
[MIT License](LICENSE)
Copyright (c) 2020 Maciej Gomółka