From 68a53add0c2a7c760514d0ee6757e146c17e8211 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Fri, 20 May 2022 15:25:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20::=20Update=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GradientLoadingBarViewModelTestCase.swift | 5 +++-- ...tyIndicatorView+AnimateIsHiddenTestCase.swift | 16 ++++++++-------- .../NotchGradientLoadingBarController.swift | 7 ++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift index b5c1bfa..9465cf7 100644 --- a/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift @@ -42,8 +42,9 @@ final class GradientLoadingBarViewModelTestCase: XCTestCase { notificationCenter: notificationCenter) // Then - let variable = try XCTUnwrap(viewModel.superview as? Variable, "Cast `Observable` instance to `Variable` in order to validate the initial value.") - XCTAssertNil(variable.value) + // The property `superview` is an optional, as well as the property `value`. + // Therefore we can't use `XCTAssertNil` here, as this doesn't work with double optionals. + XCTAssertEqual(viewModel.superview.value, .some(nil)) } func test_initializer_shouldSetupSuperviewObservable_withKeyWindow() { diff --git a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift index 26ce641..5aae393 100644 --- a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift +++ b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift @@ -44,7 +44,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_animateIsHidden_shouldShowView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // Hide view to validate fade-in. gradientActivityIndicatorView.alpha = 0 @@ -65,7 +65,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_animateIsHidden_withInterruption_shouldShowView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // Hide view to validate fade-in. gradientActivityIndicatorView.alpha = 0 @@ -88,7 +88,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_animateIsHidden_shouldHideView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // When gradientActivityIndicatorView.animate(isHidden: true, duration: 0.1) { isFinished in @@ -105,7 +105,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_animateIsHidden_withInterruption_shouldNotHideView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // When gradientActivityIndicatorView.animate(isHidden: true, duration: 0.1) { isFinished in @@ -126,7 +126,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_fadeIn_shouldShowView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // Hide view to validate fade-in. gradientActivityIndicatorView.alpha = 0 @@ -147,7 +147,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_fadeIn_withInterruption_shouldShowView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // Hide view to validate fade-in. gradientActivityIndicatorView.alpha = 0 @@ -172,7 +172,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_fadeOut_shouldHideView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // When gradientActivityIndicatorView.fadeOut(duration: 0.1) { isFinished in @@ -189,7 +189,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { func test_fadeOut_withInterruption_shouldNotHideView_andCallCompletionHandler() { // Given - let expectation = expectation(description: "Expect completion handler to be called.") + let expectation = expectation(description: "Expect completion handler to be invoked.") // When gradientActivityIndicatorView.fadeOut(duration: 0.1) { isFinished in diff --git a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift index b00b79b..f3395fa 100644 --- a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift +++ b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift @@ -22,10 +22,11 @@ private struct NotchConfig { /// Offset for the center-point of the large circle. /// - /// - A positive value for the `X` property will move the large circles closer to the center of the screen. A negative offset closer to - /// the corners of the screen. + /// - A positive value for the `X` property will move the large circles closer to the center of the screen. + /// A negative offset closer to the corners of the screen. /// - /// - A positive value for the `Y` property will move the large circles downwards. A negative offset will move them upwards. + /// - A positive value for the `Y` property will move the large circles downwards. + /// A negative offset will move them upwards. let largeCircleOffset: CGPoint /// The transform to be applied to the entire bezier path.