TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | BSD |
ReleasedLast Release | Nov 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Benoit BRIATTE.
DGDialogAnimator
is a manager allowing you to quickly display Dialogs like Toasts, Alerts or even Modal Form, with only few lines of codes.
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.
Works with iOS 8+, tested on Xcode 8.2
To install the DGDialogAnimator using cocoapods
# 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
pod install
command.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]))
You can customize the component by enabling few options:
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 |
Fastlane
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.
See CONTRIBUTING.md for more details!
This project adheres to the Contributor Covenant Code of Conduct.
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [email protected].
DGDialogAnimator is licensed under the BSD 3-Clause license.