diff --git a/CHANGELOG.md b/CHANGELOG.md index fc82781..7d50571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.2.5] - 2022-27-03 +### Fixed + - Fixed incorrect layout on `NotchGradientLoadingBar` when using iPhone 11 + ## [2.2.4] - 2022-16-03 ### Fixed - Fixed incorrect layout on `NotchGradientLoadingBar` when using iPhone XR @@ -163,9 +167,10 @@ 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.4...master -[2.2.2]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.3...2.2.4 -[2.2.2]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.2...2.2.3 +[Unreleased]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.5...master +[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 [2.2.2]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.1...2.2.2 [2.2.1]: https://github.com/fxm90/GradientLoadingBar/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/fxm90/GradientLoadingBar/compare/2.1.1...2.2.0 diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 10a0a83..cd0809c 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,11 +1,11 @@ PODS: - - GradientLoadingBar (2.2.4): + - GradientLoadingBar (2.2.5): - LightweightObservable (~> 2.1) - LightweightObservable (2.2.0) - SnapshotTesting (1.9.0) - SwiftConfigurationFiles (0.0.1) - - SwiftFormat/CLI (0.49.5) - - SwiftLint (0.46.5) + - SwiftFormat/CLI (0.49.6) + - SwiftLint (0.47.0) DEPENDENCIES: - GradientLoadingBar (from `../`) @@ -33,12 +33,12 @@ CHECKOUT OPTIONS: :git: https://github.com/fxm90/SwiftConfigurationFiles.git SPEC CHECKSUMS: - GradientLoadingBar: c649ea46db8bb18c4164ac3faae1ef960b983fa0 + GradientLoadingBar: 4daebb3ab58a17792cc998f11e5bb37f60f1feb7 LightweightObservable: a4fce3323002aa57234f3cf5524eecb144cc781f SnapshotTesting: 6141c48b6aa76ead61431ca665c14ab9a066c53b SwiftConfigurationFiles: 1cf2228a911ebed9f42f8dec077bb634f04ca6c8 - SwiftFormat: 803e5a44e083cf414b3072381db0e9e65f4c0d0d - SwiftLint: 2c16e8fa99dac2e440dc0c70ea74d2532048f6cf + SwiftFormat: e40542bcf76fdaa006d0dc26a9ca8278ca028d76 + SwiftLint: d41cc46a2ae58ac6d9f26954bc89f1d72e71fdef PODFILE CHECKSUM: 236416c4c4856713b28b6bf3da014054e9b319f2 diff --git a/Example/Pods/Local Podspecs/GradientLoadingBar.podspec.json b/Example/Pods/Local Podspecs/GradientLoadingBar.podspec.json index 883b5fd..6a3b77f 100644 --- a/Example/Pods/Local Podspecs/GradientLoadingBar.podspec.json +++ b/Example/Pods/Local Podspecs/GradientLoadingBar.podspec.json @@ -1,6 +1,6 @@ { "name": "GradientLoadingBar", - "version": "2.2.4", + "version": "2.2.5", "summary": "A customizable animated gradient loading bar.", "description": "A customizable animated gradient loading bar.\nInspired by https://codepen.io/marcobiedermann/pen/LExXWW", "homepage": "https://github.com/fxm90/GradientLoadingBar", @@ -14,7 +14,7 @@ }, "source": { "git": "https://github.com/fxm90/GradientLoadingBar.git", - "tag": "2.2.4" + "tag": "2.2.5" }, "swift_versions": "5.5", "platforms": { diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index 10a0a83..cd0809c 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,11 +1,11 @@ PODS: - - GradientLoadingBar (2.2.4): + - GradientLoadingBar (2.2.5): - LightweightObservable (~> 2.1) - LightweightObservable (2.2.0) - SnapshotTesting (1.9.0) - SwiftConfigurationFiles (0.0.1) - - SwiftFormat/CLI (0.49.5) - - SwiftLint (0.46.5) + - SwiftFormat/CLI (0.49.6) + - SwiftLint (0.47.0) DEPENDENCIES: - GradientLoadingBar (from `../`) @@ -33,12 +33,12 @@ CHECKOUT OPTIONS: :git: https://github.com/fxm90/SwiftConfigurationFiles.git SPEC CHECKSUMS: - GradientLoadingBar: c649ea46db8bb18c4164ac3faae1ef960b983fa0 + GradientLoadingBar: 4daebb3ab58a17792cc998f11e5bb37f60f1feb7 LightweightObservable: a4fce3323002aa57234f3cf5524eecb144cc781f SnapshotTesting: 6141c48b6aa76ead61431ca665c14ab9a066c53b SwiftConfigurationFiles: 1cf2228a911ebed9f42f8dec077bb634f04ca6c8 - SwiftFormat: 803e5a44e083cf414b3072381db0e9e65f4c0d0d - SwiftLint: 2c16e8fa99dac2e440dc0c70ea74d2532048f6cf + SwiftFormat: e40542bcf76fdaa006d0dc26a9ca8278ca028d76 + SwiftLint: d41cc46a2ae58ac6d9f26954bc89f1d72e71fdef PODFILE CHECKSUM: 236416c4c4856713b28b6bf3da014054e9b319f2 diff --git a/Example/Pods/SwiftFormat/CommandLineTool/swiftformat b/Example/Pods/SwiftFormat/CommandLineTool/swiftformat index 64e1c05..d3b9ef9 100755 Binary files a/Example/Pods/SwiftFormat/CommandLineTool/swiftformat and b/Example/Pods/SwiftFormat/CommandLineTool/swiftformat differ diff --git a/Example/Pods/SwiftFormat/README.md b/Example/Pods/SwiftFormat/README.md index a294bf0..81e6ddb 100644 --- a/Example/Pods/SwiftFormat/README.md +++ b/Example/Pods/SwiftFormat/README.md @@ -97,7 +97,7 @@ And then run it using: $ mint run swiftformat ``` -Or if you prefer, you can check out and build SwiftFormat manually on macOS or Linux as follows: +Or if you prefer, you can check out and build SwiftFormat manually on macOS, Linux or Windows as follows: ```bash $ git clone https://github.com/nicklockwood/SwiftFormat @@ -722,7 +722,7 @@ FAQ *Q. What platforms does SwiftFormat support?* -> A. SwiftFormat works on macOS 10.13 (High Sierra) and above, and also runs on Ubuntu Linux. +> A. SwiftFormat works on macOS 10.13 (High Sierra) and above, and also runs on Ubuntu Linux and Windows. *Q. What versions of Swift are supported?* diff --git a/Example/Pods/SwiftLint/swiftlint b/Example/Pods/SwiftLint/swiftlint index 4b7f4ec..072f804 100755 Binary files a/Example/Pods/SwiftLint/swiftlint and b/Example/Pods/SwiftLint/swiftlint differ diff --git a/Example/Pods/Target Support Files/GradientLoadingBar/GradientLoadingBar-Info.plist b/Example/Pods/Target Support Files/GradientLoadingBar/GradientLoadingBar-Info.plist index bb11c61..ce4ba6f 100644 --- a/Example/Pods/Target Support Files/GradientLoadingBar/GradientLoadingBar-Info.plist +++ b/Example/Pods/Target Support Files/GradientLoadingBar/GradientLoadingBar-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.2.4 + 2.2.5 CFBundleSignature ???? CFBundleVersion diff --git a/GradientLoadingBar.podspec b/GradientLoadingBar.podspec index c85b504..0b9e1d7 100644 --- a/GradientLoadingBar.podspec +++ b/GradientLoadingBar.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'GradientLoadingBar' - s.version = '2.2.4' + s.version = '2.2.5' s.summary = 'A customizable animated gradient loading bar.' # This description is used to generate tags and improve search results. diff --git a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift index 1a96369..050d48d 100644 --- a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift +++ b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift @@ -43,21 +43,7 @@ open class NotchGradientLoadingBarController: GradientLoadingBarController { // MARK: - Public methods override open func setupConstraints(superview: UIView) { - guard #available(iOS 11.0, *) else { - /// The notch is only available when supporting safe area layout guides, which is starting from iOS 11. - super.setupConstraints(superview: superview) - return - } - - // The `safeAreaInsets.top` always includes the status-bar and therefore will always be greater "0". - // As a workaround we check the bottom inset. - let hasNotch = superview.safeAreaInsets.bottom > 0 - - // The iPad also has a bottom inset, in order to avoid the home indicator. (https://developer.apple.com/forums/thread/110724) - // As a workaround we explicitly make sure to have a phone device. - let isIPhone = UIDevice.current.userInterfaceIdiom == .phone - - guard hasNotch, isIPhone else { + guard let notchConfig = viewModel.safeAreaDevice.notchConfig else { // No special masking required for non safe area devices. super.setupConstraints(superview: superview) return @@ -65,8 +51,7 @@ open class NotchGradientLoadingBarController: GradientLoadingBarController { // As we currently only support portrait mode (and no device rotation), we can safely use `bounds.size.width` here. let screenWidth = superview.bounds.size.width - - let notchBezierPath = notchBezierPath(for: screenWidth, notchConfig: viewModel.safeAreaDevice.notchConfig) + let notchBezierPath = notchBezierPath(for: screenWidth, notchConfig: notchConfig) // Setting the `lineWidth` draws a line, where the actual path is exactly in the middle of the drawn line. // To get the correct height (including the path) we have to add the `height` here to the given bounds (half height for top, half for bottom). @@ -230,9 +215,12 @@ open class NotchGradientLoadingBarController: GradientLoadingBarController { private extension NotchGradientLoadingBarViewModel.SafeAreaDevice { /// The notch specific configuration for the current device. - var notchConfig: NotchConfig { + var notchConfig: NotchConfig? { switch self { - case .unknown, .iPhoneX, .iPhone11: + case .unknown: + return nil + + case .iPhoneX: /// The default configuration for the iPhone X and 11. /// Values are based on . return NotchConfig(notchWidth: 208, @@ -240,7 +228,7 @@ private extension NotchGradientLoadingBarViewModel.SafeAreaDevice { largeCircleOffset: CGPoint(x: 0, y: -4.75), transform: CGAffineTransform(translationX: 0.33, y: 0)) - case .iPhoneXR: + case .iPhoneXR, .iPhone11: return NotchConfig(notchWidth: 232, largeCircleRadius: 24, largeCircleOffset: CGPoint(x: 0.5, y: -3.5),