Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digipolitan/dialog-animator
https://github.com/digipolitan/dialog-animator
alertview animation carthage cocoapods fastlane framework ios swift tvos
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/digipolitan/dialog-animator
- Owner: Digipolitan
- License: bsd-3-clause
- Created: 2017-01-18T13:52:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-15T22:47:46.000Z (over 7 years ago)
- Last Synced: 2024-12-21T20:45:20.930Z (2 months ago)
- Topics: alertview, animation, carthage, cocoapods, fastlane, framework, ios, swift, tvos
- Language: Swift
- Size: 469 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
DGDialogAnimator
================[](https://developer.apple.com/swift/)
[](https://travis-ci.org/Digipolitan/dialog-animator)
[](https://img.shields.io/cocoapods/v/DGDialogAnimator.svg)
[](https://github.com/Carthage/Carthage)
[](http://cocoadocs.org/docsets/DGDialogAnimator.svg)
[](http://twitter.com/Digipolitan)`DGDialogAnimator` is a manager allowing you to quickly display **Dialogs** like **Toasts**, **Alerts** or even **Modal Form**, with only few lines of codes.

## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
Works with iOS 8+, tested on Xcode 8.2
### Installing
To install the DGDialogAnimator using **cocoapods**
- Add an entry in your Podfile
```
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'target 'YourTarget' do
frameworks
use_frameworks!# Pods for YourTarget
pod 'DGDialogAnimator'
end
```- Then install the dependency with the `pod install` command.
## Usage
- Select the view to animate, its container, where the animation will start and where it will go.
```swift
let toast = UIView(frame: CGRect(x: 0, y: 0, width: self.view.bounds/2, height: 100))
DGDialogAnimator.default.animate(view: toast,
in: self.view,
path: DGDialogAnimator.AnimationPath(initial: .top, intermediate: .top))let notification = UIView(frame: CGRect(x: 0, y: 0, width: self.view.bounds, height: 250))
DGDialogAnimator.default.animate(view: notification,
in: self.view,
path: DGDialogAnimator.AnimationPath(initial: [.top, .left], intermediate: [.top, .right]))
```### Configuration
You can customize the component by enabling few options:
```swift
var options = DGDialogAnimator.Options()
options.hold = false
options.dismissDelay = 5
options.backdrop = false
options.blurEffectStyle = nil
// ....
DGDialogAnimator.default.animate(view: toast,
in: self.view,
with: options,
path: DGDialogAnimator.AnimationPath(initial: .top, intermediate: .top))```
Here the list of all available options :
| Property | type | Description |
| --- | --- | --- |
| backdrop | `Bool` | Tells if the background behind the animated view will dismiss the view on touch |
| blurEffectStyle | `UIBlurEffectStyle` | The blur effect added to the background. 3 values are available `.light` `.extraLight` `.dark` |
| coverStatusBar | `Bool` | if set to `true` you must **NOT** set the container because the component will use automatically `UIWindow`. |
| animationDuration | `TimeInterval` | How long the animation will last. |
| dismissDelay | `TimeInterval` | How long the animated view will hold before dismissing itself |
| enterAnimationCurve | `UIViewAnimationCurve` | Let you configure the animation curve when the view comes in the container |
| leaveAnimationCurve | `UIViewAnimationCurve` | Let you configure the animation curve when the view leaves in the container |
| hold | `Bool` | The view won't dismiss after `dismissDelay`. It will wait a call to the `dismiss()` method |## Built With
[Fastlane](https://fastlane.tools/)
Fastlane is a tool for iOS, Mac, and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles, and releasing your application.## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details!
This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [[email protected]](mailto:[email protected]).## License
DGDialogAnimator is licensed under the [BSD 3-Clause license](LICENSE).