-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from teufelaudio/lottie-animation-progress-envi…
…ronment-key Added new environment key to be able to change the animation progress
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Sources/LottieExtensions/LottieAnimationProgressEnvironmentKey.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright © 2022 Lautsprecher Teufel GmbH. All rights reserved. | ||
|
||
import SwiftUI | ||
|
||
extension EnvironmentValues { | ||
var lottieAnimationProgress: CGFloat { | ||
get { return self[LottieAnimationProgressEnvironmentKey.self] } | ||
set { self[LottieAnimationProgressEnvironmentKey.self] = newValue } | ||
} | ||
} | ||
|
||
public struct LottieAnimationProgressEnvironmentKey: EnvironmentKey { | ||
public static let defaultValue: CGFloat = 0.5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters