Skip to content

Commit

Permalink
Stop the animation at the appear of the view.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpolychronakis committed Jun 29, 2020
1 parent 5ac9e1d commit e86a769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/FlipAnimation/FlipAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extension View {
/// - Returns: It returns the same view with some modifiers attached
public func flip(frontSideVisible: Bool, duration: Double = 1.0) -> some View {
return self
.animation(Animation.linear(duration: 0.01).delay(duration/2.0))
.animation(Animation.linear(duration: 0.01).delay(duration/2.0), value: frontSideVisible)
.rotation3DEffect(Angle(degrees: frontSideVisible ? 0.0 : 180), axis: (x: 0, y: 1, z: 0))
.animation(Animation.easeInOut(duration: duration))
.animation(Animation.easeInOut(duration: duration), value: frontSideVisible)
}
}
2 changes: 1 addition & 1 deletion Tests/FlipAnimationTests/FlipAnimationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ final class FlipAnimationTests: XCTestCase {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(FlipAnimation().text, "Hello, World!")
// XCTAssertEqual(FlipAnimation().text, "Hello, World!")
}

static var allTests = [
Expand Down

0 comments on commit e86a769

Please sign in to comment.