From 9012d6ec6a0c0e82beded622d1cca0d2d83c5349 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Thu, 28 Apr 2022 08:55:58 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20::=20Fix=20invalid=20compari?= =?UTF-8?q?son=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d50571..a404ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -167,7 +167,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Initial release -[Unreleased]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.5...master +[Unreleased]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.5...main [2.2.5]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.4...2.2.5 [2.2.4]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.3...2.2.4 [2.2.3]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.2...2.2.3 From 587e6d0095107aa1c41772ff1f85efe97abaeea4 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Thu, 28 Apr 2022 08:58:19 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20::=20Update=20dev-depe?= =?UTF-8?q?ndencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Example/Gemfile.lock | 90 +++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/Example/Gemfile.lock b/Example/Gemfile.lock index 9b1c2de..83e7438 100644 --- a/Example/Gemfile.lock +++ b/Example/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (6.1.4.1) + activesupport (6.1.5.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -17,27 +17,27 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.539.0) - aws-sdk-core (3.124.0) + aws-partitions (1.581.0) + aws-sdk-core (3.130.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.52.0) - aws-sdk-core (~> 3, >= 3.122.0) + aws-sdk-kms (1.56.0) + aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.109.0) - aws-sdk-core (~> 3, >= 3.122.0) + aws-sdk-s3 (1.113.2) + aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.4.0) + aws-sigv4 (1.5.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) - claide (1.0.3) - cocoapods (1.11.2) + claide (1.1.0) + cocoapods (1.11.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.2) + cocoapods-core (= 1.11.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -52,7 +52,7 @@ GEM nap (~> 1.0) ruby-macho (>= 1.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.2) + cocoapods-core (1.11.3) activesupport (>= 5.0, < 7) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -63,7 +63,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.1) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -75,7 +75,7 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -86,17 +86,18 @@ GEM escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) - excon (0.88.0) - faraday (1.8.0) + excon (0.92.3) + faraday (1.10.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) + faraday-net_http_persistent (~> 1.0) faraday-patron (~> 1.0) faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) @@ -105,14 +106,17 @@ GEM faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) + faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.5) - fastlane (2.198.1) + fastimage (2.2.6) + fastlane (2.205.2) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -151,14 +155,14 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-swiftformat (0.1.0) - ffi (1.15.4) + fastlane-plugin-swiftformat (0.2.0) + ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.13.0) + google-apis-androidpublisher_v3 (0.19.0) google-apis-core (>= 0.4, < 2.a) - google-apis-core (0.4.1) + google-apis-core (0.4.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -167,28 +171,28 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.8.0) + google-apis-iamcredentials_v1 (0.10.0) google-apis-core (>= 0.4, < 2.a) - google-apis-playcustomapp_v1 (0.6.0) + google-apis-playcustomapp_v1 (0.7.0) google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.9.0) + google-apis-storage_v1 (0.13.0) google-apis-core (>= 0.4, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.5.0) - faraday (>= 0.17.3, < 2.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.2.0) - google-cloud-storage (1.34.1) - addressable (~> 2.5) + google-cloud-storage (1.36.2) + addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) google-apis-storage_v1 (~> 0.1) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.1.0) - faraday (>= 0.17.3, < 2.0) + googleauth (1.1.3) + faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) @@ -198,15 +202,15 @@ GEM http-cookie (1.0.4) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.8.11) + i18n (1.10.0) concurrent-ruby (~> 1.0) - jmespath (1.4.0) + jmespath (1.6.1) json (2.6.1) jwt (2.3.0) memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.2) - minitest (5.14.4) + minitest (5.15.0) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.0.0) @@ -217,7 +221,7 @@ GEM optparse (0.1.1) os (1.1.4) plist (3.6.0) - public_suffix (4.0.6) + public_suffix (4.0.7) rake (13.0.6) representable (3.1.1) declarative (< 0.1.0) @@ -230,9 +234,9 @@ GEM ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.16.0) + signet (0.16.1) addressable (~> 2.8) - faraday (>= 0.17.3, < 2.0) + faraday (>= 0.17.5, < 3.0) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simctl (1.6.8) @@ -253,7 +257,7 @@ GEM uber (0.1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.8.1) unicode-display_width (1.8.0) webrick (1.7.0) word_wrap (1.0.0) @@ -268,7 +272,7 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.5.1) + zeitwerk (2.5.4) PLATFORMS ruby @@ -279,4 +283,4 @@ DEPENDENCIES fastlane-plugin-swiftformat BUNDLED WITH - 2.1.4 + 2.3.8 From ffdc50eadacc91cd149daa2c78c2b3776478c9ad Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Fri, 29 Apr 2022 18:05:00 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=8E=A8=20::=20Format=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdvancedExample/AdvancedExampleTableViewController.swift | 3 --- .../Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift | 4 ++++ ...radientActivityIndicatorView+AnimateIsHiddenTestCase.swift | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift b/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift index f4df383..70dabb8 100644 --- a/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift +++ b/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift @@ -21,10 +21,7 @@ final class AdvancedExampleTableViewController: UITableViewController { #colorLiteral(red: 0.9490196078, green: 0.3215686275, blue: 0.431372549, alpha: 1), #colorLiteral(red: 0.9450980392, green: 0.4784313725, blue: 0.5921568627, alpha: 1), #colorLiteral(red: 0.9529411765, green: 0.737254902, blue: 0.7843137255, alpha: 1), #colorLiteral(red: 0.4274509804, green: 0.8666666667, blue: 0.9490196078, alpha: 1), #colorLiteral(red: 0.7568627451, green: 0.9411764706, blue: 0.9568627451, alpha: 1), ] - /// static let firstSectionHeaderHeight: CGFloat = 48 - - /// static let defaultSectionHeaderHeight: CGFloat = 32 } diff --git a/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift b/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift index 6784229..925cf30 100644 --- a/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift +++ b/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift @@ -34,6 +34,7 @@ struct SwiftUIExampleView: View { // MARK: - Subviews private struct DefaultExampleView: View { + @State private var isVisible = true @@ -69,6 +70,7 @@ private struct DefaultExampleView: View { } private struct CustomColorsExampleView: View { + private enum Config { /// The custom gradient colors we use. /// Source: https://color.adobe.com/Pink-Flamingo-color-theme-10343714/ @@ -112,6 +114,7 @@ private struct CustomColorsExampleView: View { } private struct CustomProgressDurationExampleView: View { + private enum Config { /// The custom progress duration to use. static let progressDuration: TimeInterval = 10 @@ -154,6 +157,7 @@ private struct CustomProgressDurationExampleView: View { // MARK: - Helper private struct RoundedRectangleButtonStyle: ButtonStyle { + func makeBody(configuration: Configuration) -> some View { configuration.label .padding(12) diff --git a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift index 1ab78ad..26ce641 100644 --- a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift +++ b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift @@ -60,7 +60,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { wait(for: [expectation], timeout: 1) XCTAssertFalse(gradientActivityIndicatorView.isHidden) - XCTAssertEqual(gradientActivityIndicatorView.alpha, 1.0, accuracy: CGFloat.ulpOfOne) + XCTAssertEqual(gradientActivityIndicatorView.alpha, 1, accuracy: CGFloat.ulpOfOne) } func test_animateIsHidden_withInterruption_shouldShowView_andCallCompletionHandler() { @@ -142,7 +142,7 @@ final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { wait(for: [expectation], timeout: 1) XCTAssertFalse(gradientActivityIndicatorView.isHidden) - XCTAssertEqual(gradientActivityIndicatorView.alpha, 1.0, accuracy: CGFloat.ulpOfOne) + XCTAssertEqual(gradientActivityIndicatorView.alpha, 1, accuracy: CGFloat.ulpOfOne) } func test_fadeIn_withInterruption_shouldShowView_andCallCompletionHandler() { From f6a959a4b58ea3316169df9f73b729624d175fc6 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Fri, 29 Apr 2022 18:05:09 +0100 Subject: [PATCH 4/5] =?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 --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index f49f71b..67232e7 100644 --- a/readme.md +++ b/readme.md @@ -50,7 +50,7 @@ This framework provides four classes: - **GradientLoadingBar**: A controller, managing the visibility of the `GradientActivityIndicatorView` on the current key window. - **NotchGradientLoadingBar**: A subclass of `GradientLoadingBar`, wrapping the `GradientActivityIndicatorView` around the notch of the iPhone. - **GradientActivityIndicatorView**: A `UIView` containing the gradient with the animation. It can be added as a subview to another view either inside the interface builder or programmatically. Both ways are shown inside the example application. - - **GradientLoadingBarView**: A `View` for SwiftUI containing the gradient with the animation. The view can be added to any other SwiftUI view. The example application also contains same sample code for this use case. + - **GradientLoadingBarView**: A `View` for SwiftUI containing the gradient with the animation. The view can be added to any other SwiftUI view. The example application also contains sample code for this use case. #### GradientLoadingBar To get started, import the module `GradientLoadingBar` into your file and save an instance of `GradientLoadingBar()` on a property of your view-controller. To show the loading bar, simply call the `fadeIn(duration:completion)` method and after your async operations have finished call the `fadeOut(duration:completion)` method. @@ -171,12 +171,12 @@ This property adjusts the duration of the animation moving the gradient from lef #### GradientLoadingBarView -This is the SwiftUI variant for the `GradientActivityIndicatorView`. The view can be configured via the two parameters `gradientColors: [Color]` and `progressAnimation: Animation` passed to the initializer. +This is the SwiftUI variant for the `GradientActivityIndicatorView`. The view can be configured via the two parameters `gradientColors: [Color]` and `progressDuration: TimeInterval` passed to the initializer. ##### – `gradientColors: [Color]` : This parameter adjusts the gradient colors shown on the loading bar. -##### – `progressAnimation: Animation` : +##### – `progressDuration: TimeInterval` : This parameter adjusts the duration of the animation moving the gradient from left to right. The visibility of the view can be updated with the view modifier [`opacity()`](https://developer.apple.com/documentation/swiftui/view/opacity(_:)) or [`hidden()`](https://developer.apple.com/documentation/swiftui/view/hidden()). From 1b41081034c4494c59bda98f9081d133e8b3cb86 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Fri, 29 Apr 2022 18:06:32 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20::=20Format=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GradientLoadingBarView/GradientLoadingBarView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift index 38440ce..f663190 100644 --- a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift +++ b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift @@ -50,10 +50,11 @@ public struct GradientLoadingBarView: View { viewModel.size = $0 } // Using an `overlay` here makes sure that the parent view won't change it's frame. - .overlay(// + .overlay( LinearGradient(colors: viewModel.gradientColors, startPoint: .leading, endPoint: .trailing) .frame(width: viewModel.gradientWidth) - .offset(x: viewModel.horizontalOffset, y: 0)) + .offset(x: viewModel.horizontalOffset, y: 0) + ) } }