From 846005af52dc07b85dd06d012a7b21aef1cc6350 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Thu, 28 Apr 2022 08:49:17 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20Update=20`//=20MARK:?= =?UTF-8?q?=20-=20`=20statements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Example/Example/Helper/StoryboardView.swift | 3 ++- .../AdvancedExample/AdvancedExampleTableViewController.swift | 1 + .../AdvancedExample/Cells/CustomColorsTableViewCell.swift | 1 + .../AdvancedExample/Cells/CustomSuperviewTableViewCell.swift | 1 + .../Cells/InterfaceBuilderSetupTableViewCell.swift | 1 + .../Scenes/AdvancedExample/Views/BorderedButton.swift | 3 ++- .../Scenes/BasicExample/BasicExampleViewController.swift | 3 ++- Example/Example/Scenes/EntryPointView.swift | 1 + .../NavigationBarExampleViewController.swift | 3 ++- .../SafeAreaExample/SafeAreaExampleViewController.swift | 3 ++- .../Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift | 1 + .../GradientActivityIndicatorViewTestCase.swift | 1 + .../GradientLoadingBarControllerTestCase.swift | 1 + .../GradientLoadingBarViewTestCase.swift | 1 + .../GradientActivityIndicatorViewModelTestCase.swift | 4 +++- .../ViewModel/GradientLoadingBarView+ViewModelTestCase.swift | 1 + .../ViewModel/GradientLoadingBarViewModelTestCase.swift | 1 + ...adientActivityIndicatorView+AnimateIsHiddenTestCase.swift | 1 + .../LightweightObservable/Disposable.swift | 3 ++- .../GradientActivityIndicatorView+AnimateIsHidden.swift | 1 - .../GradientActivityIndicatorView.swift | 3 ++- .../GradientActivityIndicatorViewModel.swift | 5 +++-- .../GradientLoadingBar/GradientLoadingBarController.swift | 3 ++- .../GradientLoadingBar/GradientLoadingBarViewModel.swift | 3 ++- .../GradientLoadingBarView+ViewModel.swift | 3 ++- .../GradientLoadingBarView/GradientLoadingBarView.swift | 3 ++- .../NotchGradientLoadingBarController.swift | 3 ++- .../NotchGradientLoadingBarViewModel.swift | 5 +++-- 28 files changed, 45 insertions(+), 18 deletions(-) diff --git a/Example/Example/Helper/StoryboardView.swift b/Example/Example/Helper/StoryboardView.swift index d88818b..64a8d2c 100644 --- a/Example/Example/Helper/StoryboardView.swift +++ b/Example/Example/Helper/StoryboardView.swift @@ -9,11 +9,12 @@ import SwiftUI struct StoryboardView: UIViewControllerRepresentable { + // MARK: - Public properties let name: String - // MARK: - Public properties + // MARK: - Public methods func makeUIViewController(context _: Context) -> UIViewController { let storyboard = UIStoryboard(name: name, bundle: nil) diff --git a/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift b/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift index e4448ba..f4df383 100644 --- a/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift +++ b/Example/Example/Scenes/AdvancedExample/AdvancedExampleTableViewController.swift @@ -11,6 +11,7 @@ import SwiftUI import GradientLoadingBar final class AdvancedExampleTableViewController: UITableViewController { + // MARK: - Config private enum Config { diff --git a/Example/Example/Scenes/AdvancedExample/Cells/CustomColorsTableViewCell.swift b/Example/Example/Scenes/AdvancedExample/Cells/CustomColorsTableViewCell.swift index 7a6880a..61a5343 100644 --- a/Example/Example/Scenes/AdvancedExample/Cells/CustomColorsTableViewCell.swift +++ b/Example/Example/Scenes/AdvancedExample/Cells/CustomColorsTableViewCell.swift @@ -9,6 +9,7 @@ import UIKit final class CustomColorsTableViewCell: UITableViewCell { + // MARK: - Public properties static let reuseIdentifier = "CustomColorsTableViewCell" diff --git a/Example/Example/Scenes/AdvancedExample/Cells/CustomSuperviewTableViewCell.swift b/Example/Example/Scenes/AdvancedExample/Cells/CustomSuperviewTableViewCell.swift index c2333f6..47543b9 100644 --- a/Example/Example/Scenes/AdvancedExample/Cells/CustomSuperviewTableViewCell.swift +++ b/Example/Example/Scenes/AdvancedExample/Cells/CustomSuperviewTableViewCell.swift @@ -10,6 +10,7 @@ import UIKit import GradientLoadingBar final class CustomSuperviewTableViewCell: UITableViewCell { + // MARK: - Config private enum Config { diff --git a/Example/Example/Scenes/AdvancedExample/Cells/InterfaceBuilderSetupTableViewCell.swift b/Example/Example/Scenes/AdvancedExample/Cells/InterfaceBuilderSetupTableViewCell.swift index ae4f5f0..dfc0702 100644 --- a/Example/Example/Scenes/AdvancedExample/Cells/InterfaceBuilderSetupTableViewCell.swift +++ b/Example/Example/Scenes/AdvancedExample/Cells/InterfaceBuilderSetupTableViewCell.swift @@ -10,6 +10,7 @@ import UIKit import GradientLoadingBar final class InterfaceBuilderSetupTableViewCell: UITableViewCell { + // MARK: - Config private enum Config { diff --git a/Example/Example/Scenes/AdvancedExample/Views/BorderedButton.swift b/Example/Example/Scenes/AdvancedExample/Views/BorderedButton.swift index 31a180f..fba8592 100644 --- a/Example/Example/Scenes/AdvancedExample/Views/BorderedButton.swift +++ b/Example/Example/Scenes/AdvancedExample/Views/BorderedButton.swift @@ -10,6 +10,7 @@ import UIKit @IBDesignable final class BorderedButton: UIButton { + // MARK: - Config private enum Config { @@ -18,7 +19,7 @@ final class BorderedButton: UIButton { static let cornerRadius: CGFloat = 4 } - // MARK: - Initializer + // MARK: - Instance Lifecycle override init(frame: CGRect) { super.init(frame: frame) diff --git a/Example/Example/Scenes/BasicExample/BasicExampleViewController.swift b/Example/Example/Scenes/BasicExample/BasicExampleViewController.swift index a7fae8a..289ed17 100644 --- a/Example/Example/Scenes/BasicExample/BasicExampleViewController.swift +++ b/Example/Example/Scenes/BasicExample/BasicExampleViewController.swift @@ -11,6 +11,7 @@ import SwiftUI import GradientLoadingBar final class BasicExampleViewController: UIViewController { + // MARK: - Public methods override func viewWillDisappear(_ animated: Bool) { @@ -31,7 +32,7 @@ final class BasicExampleViewController: UIViewController { } } -// MARK: - Helpers +// MARK: - Helper struct BasicExampleView: View { var body: some View { diff --git a/Example/Example/Scenes/EntryPointView.swift b/Example/Example/Scenes/EntryPointView.swift index 4353925..604f169 100644 --- a/Example/Example/Scenes/EntryPointView.swift +++ b/Example/Example/Scenes/EntryPointView.swift @@ -9,6 +9,7 @@ import SwiftUI struct EntryPointView: View { + // MARK: - Private properties @State diff --git a/Example/Example/Scenes/NavigationBarExample/NavigationBarExampleViewController.swift b/Example/Example/Scenes/NavigationBarExample/NavigationBarExampleViewController.swift index 200cbb4..4ed3a44 100644 --- a/Example/Example/Scenes/NavigationBarExample/NavigationBarExampleViewController.swift +++ b/Example/Example/Scenes/NavigationBarExample/NavigationBarExampleViewController.swift @@ -11,6 +11,7 @@ import SwiftUI import GradientLoadingBar final class NavigationBarExampleViewController: UIViewController { + // MARK: - Config private enum Config { @@ -70,7 +71,7 @@ final class NavigationBarExampleViewController: UIViewController { } } -// MARK: - Helpers +// MARK: - Helper struct NavigationBarExampleView: View { var body: some View { diff --git a/Example/Example/Scenes/SafeAreaExample/SafeAreaExampleViewController.swift b/Example/Example/Scenes/SafeAreaExample/SafeAreaExampleViewController.swift index ce54bdb..c4d6be7 100644 --- a/Example/Example/Scenes/SafeAreaExample/SafeAreaExampleViewController.swift +++ b/Example/Example/Scenes/SafeAreaExample/SafeAreaExampleViewController.swift @@ -11,6 +11,7 @@ import SwiftUI import GradientLoadingBar final class SafeAreaExampleViewController: UIViewController { + // MARK: - Private properties private let gradientLoadingBar = GradientLoadingBar(isRelativeToSafeArea: false) @@ -45,7 +46,7 @@ final class SafeAreaExampleViewController: UIViewController { } } -// MARK: - Helpers +// MARK: - Helper struct SafeAreaExampleView: View { var body: some View { diff --git a/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift b/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift index a91709f..6784229 100644 --- a/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift +++ b/Example/Example/Scenes/SwiftUIExample/SwiftUIExampleView.swift @@ -10,6 +10,7 @@ import SwiftUI import GradientLoadingBar struct SwiftUIExampleView: View { + // MARK: - Render var body: some View { diff --git a/Example/ExampleSnapshotTests/GradientActivityIndicatorView/GradientActivityIndicatorViewTestCase.swift b/Example/ExampleSnapshotTests/GradientActivityIndicatorView/GradientActivityIndicatorViewTestCase.swift index 8617c5f..2e55a5b 100644 --- a/Example/ExampleSnapshotTests/GradientActivityIndicatorView/GradientActivityIndicatorViewTestCase.swift +++ b/Example/ExampleSnapshotTests/GradientActivityIndicatorView/GradientActivityIndicatorViewTestCase.swift @@ -12,6 +12,7 @@ import SnapshotTesting @testable import GradientLoadingBar final class GradientActivityIndicatorViewTestCase: XCTestCase { + // MARK: - Config private enum Config { diff --git a/Example/ExampleSnapshotTests/GradientLoadingBarController/GradientLoadingBarControllerTestCase.swift b/Example/ExampleSnapshotTests/GradientLoadingBarController/GradientLoadingBarControllerTestCase.swift index 8ab8aaf..dd0a0a2 100644 --- a/Example/ExampleSnapshotTests/GradientLoadingBarController/GradientLoadingBarControllerTestCase.swift +++ b/Example/ExampleSnapshotTests/GradientLoadingBarController/GradientLoadingBarControllerTestCase.swift @@ -12,6 +12,7 @@ import SnapshotTesting @testable import GradientLoadingBar final class GradientLoadingBarControllerTestCase: XCTestCase { + // MARK: - Config private enum Config { diff --git a/Example/ExampleSnapshotTests/GradientLoadingBarView/GradientLoadingBarViewTestCase.swift b/Example/ExampleSnapshotTests/GradientLoadingBarView/GradientLoadingBarViewTestCase.swift index dbe028a..3a81ca4 100644 --- a/Example/ExampleSnapshotTests/GradientLoadingBarView/GradientLoadingBarViewTestCase.swift +++ b/Example/ExampleSnapshotTests/GradientLoadingBarView/GradientLoadingBarViewTestCase.swift @@ -13,6 +13,7 @@ import SnapshotTesting @testable import GradientLoadingBar final class GradientLoadingBarViewTestCase: XCTestCase { + // MARK: - Config private enum Config { diff --git a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift index 4aafa95..dc39fe0 100644 --- a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift @@ -13,6 +13,7 @@ import LightweightObservable // swiftlint:disable:next type_name final class GradientActivityIndicatorViewModelTestCase: XCTestCase { + // MARK: - Private properties private var viewModel: GradientActivityIndicatorViewModel! @@ -166,9 +167,10 @@ final class GradientActivityIndicatorViewModelTestCase: XCTestCase { } } -// MARK: - Helpers +// MARK: - Helper extension GradientActivityIndicatorViewModelTestCase { + private func makeGradientLayerColors() -> [CGColor] { let gradientColors = [ #colorLiteral(red: 0.2980392157, green: 0.8509803922, blue: 0.3921568627, alpha: 1), #colorLiteral(red: 0.3529411765, green: 0.7843137255, blue: 0.9803921569, alpha: 1), #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1), #colorLiteral(red: 0.2039215686, green: 0.6666666667, blue: 0.862745098, alpha: 1), #colorLiteral(red: 0.3450980392, green: 0.337254902, blue: 0.8392156863, alpha: 1), #colorLiteral(red: 1, green: 0.1764705882, blue: 0.3333333333, alpha: 1), diff --git a/Example/ExampleTests/ViewModel/GradientLoadingBarView+ViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientLoadingBarView+ViewModelTestCase.swift index 0ce7431..849b546 100644 --- a/Example/ExampleTests/ViewModel/GradientLoadingBarView+ViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientLoadingBarView+ViewModelTestCase.swift @@ -13,6 +13,7 @@ import SwiftUI // swiftlint:disable:next type_name final class GradientLoadingBarView_ViewModelTestCase: XCTestCase { + // MARK: - Test property `gradientColors` func test_initialGradientColors_shouldIncludeReversedGradientColors() { diff --git a/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift index 2b923e0..b5c1bfa 100644 --- a/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientLoadingBarViewModelTestCase.swift @@ -12,6 +12,7 @@ import LightweightObservable @testable import GradientLoadingBar final class GradientLoadingBarViewModelTestCase: XCTestCase { + // MARK: - Private properties private var sharedApplicationMock: SharedApplicationMock! diff --git a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift index c289d88..1ab78ad 100644 --- a/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift +++ b/Example/ExampleTests/Views/GradientActivityIndicatorView+AnimateIsHiddenTestCase.swift @@ -12,6 +12,7 @@ import XCTest // swiftlint:disable:next type_name final class GradientActivityIndicatorViewAnimateIsHiddenTestCase: XCTestCase { + // MARK: - Private properties private var window: UIWindow! diff --git a/Example/Pods/LightweightObservable/LightweightObservable/Disposable.swift b/Example/Pods/LightweightObservable/LightweightObservable/Disposable.swift index 9864946..661dd6d 100644 --- a/Example/Pods/LightweightObservable/LightweightObservable/Disposable.swift +++ b/Example/Pods/LightweightObservable/LightweightObservable/Disposable.swift @@ -13,6 +13,7 @@ public typealias DisposeBag = [Disposable] /// Calls a closure on when this instance is deallocated. public final class Disposable { + // MARK: - Types /// Type for the closure to be called on deallocation. @@ -23,7 +24,7 @@ public final class Disposable { /// The closure to be called on deallocation. private let dispose: Dispose - // MARK: - Initializer + // MARK: - Instance Lifecycle /// Creates a new instance. /// diff --git a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView+AnimateIsHidden.swift b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView+AnimateIsHidden.swift index 0a5ce3f..7abcdb8 100644 --- a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView+AnimateIsHidden.swift +++ b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView+AnimateIsHidden.swift @@ -16,7 +16,6 @@ import UIKit /// /// - SeeAlso: [Github Gist – UIView+AnimateIsHidden.swift](https://gist.github.com/fxm90/723b5def31b46035cd92a641e3b184f6) public extension GradientActivityIndicatorView { - // MARK: - Public methods /// Updates the view visibility. /// diff --git a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView.swift b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView.swift index 93686a0..6f809e4 100644 --- a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView.swift +++ b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorView.swift @@ -11,6 +11,7 @@ import LightweightObservable @IBDesignable open class GradientActivityIndicatorView: UIView { + // MARK: - Config /// Animation-Key for the progress animation. @@ -68,7 +69,7 @@ open class GradientActivityIndicatorView: UIView { /// The dispose bag for the observables. private var disposeBag = DisposeBag() - // MARK: - Initializers + // MARK: - Instance Lifecycle override public init(frame: CGRect) { super.init(frame: frame) diff --git a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift index eec7ea3..5a6ab51 100644 --- a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift +++ b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift @@ -42,6 +42,7 @@ typealias ColorLocationMatrix = [ColorLocationRow] /// /// As the colors at the start are the same as at the end, we can loop the animation without visual artefacts. final class GradientActivityIndicatorViewModel { + // MARK: - Public properties /// Observable color array for the gradient layer (of type `CGColor`). @@ -104,7 +105,7 @@ final class GradientActivityIndicatorViewModel { private let animationDurationSubject = Variable(TimeInterval.GradientLoadingBar.progressDuration) private let isAnimatingSubject = Variable(true) - // MARK: - Initializer + // MARK: - Instance Lifecycle init() { let gradientLayerColors = ColorLocationRow.gradientLayerColors(from: gradientColors) @@ -116,7 +117,7 @@ final class GradientActivityIndicatorViewModel { } } -// MARK: - Helpers +// MARK: - Helper private extension ColorLocationRow { /// Generates the colors used on the gradient-layer. diff --git a/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarController.swift b/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarController.swift index 6e1b1e8..545b4e7 100644 --- a/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarController.swift +++ b/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarController.swift @@ -14,6 +14,7 @@ public typealias GradientLoadingBar = GradientLoadingBarController /// The `GradientLoadingBarController` mediates between the `GradientLoadingBarViewModel` and the corresponding `GradientActivityIndicatorView`. open class GradientLoadingBarController { + // MARK: - Public properties /// The height of the gradient bar. @@ -58,7 +59,7 @@ open class GradientLoadingBarController { /// The dispose bag for the observables. private var disposeBag = DisposeBag() - // MARK: - Initializers + // MARK: - Instance Lifecycle /// Creates a new gradient loading bar instance. /// diff --git a/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarViewModel.swift b/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarViewModel.swift index 5d4e740..b384d9b 100644 --- a/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarViewModel.swift +++ b/GradientLoadingBar/Feature/GradientLoadingBar/GradientLoadingBarViewModel.swift @@ -12,6 +12,7 @@ import LightweightObservable /// This view model checks for the availability of the key-window, /// and adds it as a superview to the gradient-view. final class GradientLoadingBarViewModel { + // MARK: - Public properties /// Observable for the superview of the gradient-view. @@ -28,7 +29,7 @@ final class GradientLoadingBarViewModel { private let sharedApplication: UIApplicationProtocol private let notificationCenter: NotificationCenter - // MARK: - Constructor + // MARK: - Instance Lifecycle init(sharedApplication: UIApplicationProtocol = UIApplication.shared, notificationCenter: NotificationCenter = .default) { self.sharedApplication = sharedApplication diff --git a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift index 6af3187..6c6330e 100644 --- a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift +++ b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView+ViewModel.swift @@ -14,6 +14,7 @@ extension GradientLoadingBarView { /// This view model contains all logic related to the `GradientLoadingBarView` /// and the corresponding progress animation. final class ViewModel: ObservableObject { + // MARK: - Public properties /// The gradient colors used for the progress animation (including the reversed colors). @@ -51,7 +52,7 @@ extension GradientLoadingBarView { private var progressDuration: TimeInterval - // MARK: - Public methods + // MARK: - Instance Lifecycle init(gradientColors: [Color], progressDuration: TimeInterval) { // Simulate infinite animation - Therefore we'll reverse the colors and remove the first and last item diff --git a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift index 6a68342..38440ce 100644 --- a/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift +++ b/GradientLoadingBar/Feature/GradientLoadingBarView/GradientLoadingBarView.swift @@ -11,6 +11,7 @@ import SwiftUI // For some reason the animation looks broken on iOS versions <= 15.0. @available(iOS 15.0, *) public struct GradientLoadingBarView: View { + // MARK: - Config public enum Config { @@ -26,7 +27,7 @@ public struct GradientLoadingBarView: View { @StateObject private var viewModel: ViewModel - // MARK: - Initializer + // MARK: - Instance Lifecycle public init(gradientColors: [Color] = Config.gradientColors, progressDuration: TimeInterval = Config.progressDuration) { diff --git a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift index 41bf674..16e06b5 100644 --- a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift +++ b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarController.swift @@ -36,6 +36,7 @@ private struct NotchConfig { public typealias NotchGradientLoadingBar = NotchGradientLoadingBarController open class NotchGradientLoadingBarController: GradientLoadingBarController { + // MARK: - Private properties private let viewModel = NotchGradientLoadingBarViewModel() @@ -209,7 +210,7 @@ open class NotchGradientLoadingBarController: GradientLoadingBarController { } } -// MARK: - Helpers +// MARK: - Helper private extension NotchGradientLoadingBarViewModel.SafeAreaDevice { /// The notch specific configuration for the current device. diff --git a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarViewModel.swift b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarViewModel.swift index e35b3b9..69e531a 100644 --- a/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarViewModel.swift +++ b/GradientLoadingBar/Feature/NotchGradientLoadingBar/NotchGradientLoadingBarViewModel.swift @@ -9,6 +9,7 @@ import UIKit final class NotchGradientLoadingBarViewModel { + // MARK: - Types enum SafeAreaDevice { @@ -25,14 +26,14 @@ final class NotchGradientLoadingBarViewModel { /// The current safe area device. let safeAreaDevice: SafeAreaDevice - // MARK: - Initializer + // MARK: - Instance Lifecycle init(deviceIdentifier: String = UIDevice.identifier) { safeAreaDevice = SafeAreaDevice(deviceIdentifier: deviceIdentifier) } } -// MARK: - Helpers +// MARK: - Helper private extension NotchGradientLoadingBarViewModel.SafeAreaDevice { /// Creates a new instance from a given `deviceIdentifier` (value returned by `UIDevice.identifier`).