-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue-26] Customize animations (#28)
* [Issue-26] Customize animations * Remove source code from README
- Loading branch information
Mark Pospesel
authored
May 5, 2023
1 parent
7c61299
commit 2b0f317
Showing
12 changed files
with
143 additions
and
81 deletions.
There are no files selected for viewing
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
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
18 changes: 18 additions & 0 deletions
18
Sources/YBottomSheet/Animation/Animation+BottomSheet.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,18 @@ | ||
// | ||
// Animation+BottomSheet.swift | ||
// YBottomSheet | ||
// | ||
// Created by Mark Pospesel on 5/4/23. | ||
// Copyright © 2023 Y Media Labs. All rights reserved. | ||
// | ||
|
||
import YCoreUI | ||
|
||
/// Default animations for bottom sheets | ||
public extension Animation { | ||
/// Default animation for presenting a bottom sheet | ||
static let defaultPresent = Animation(curve: .regular(options: .curveEaseIn)) | ||
|
||
/// Default animation for dismissing a bottom sheet | ||
static let defaultDismiss = Animation(curve: .regular(options: .curveEaseOut)) | ||
} |
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
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
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
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
33 changes: 33 additions & 0 deletions
33
Tests/YBottomSheetTests/Animation/Animation+BottomSheetTests.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,33 @@ | ||
// | ||
// Animation+BottomSheetTests.swift | ||
// YBottomSheet | ||
// | ||
// Created by Mark Pospesel on 5/4/23. | ||
// Copyright © 2023 Y Media Labs. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import YCoreUI | ||
@testable import YBottomSheet | ||
|
||
final class AnimationBottomSheetTests: XCTestCase { | ||
func test_defaultPresent() { | ||
// Given | ||
let sut = Animation.defaultPresent | ||
|
||
// Then | ||
XCTAssertEqual(sut.duration, 0.3) | ||
XCTAssertEqual(sut.delay, 0.0) | ||
XCTAssertEqual(sut.curve, .regular(options: .curveEaseIn)) | ||
} | ||
|
||
func test_defaultDismiss() { | ||
// Given | ||
let sut = Animation.defaultDismiss | ||
|
||
// Then | ||
XCTAssertEqual(sut.duration, 0.3) | ||
XCTAssertEqual(sut.delay, 0.0) | ||
XCTAssertEqual(sut.curve, .regular(options: .curveEaseOut)) | ||
} | ||
} |
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
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
Oops, something went wrong.