diff --git a/Samples/AlertContainer/Sources/AlertContainerScreen.swift b/Samples/AlertContainer/Sources/AlertContainerScreen.swift index dc84afe0d..fb9a6954a 100644 --- a/Samples/AlertContainer/Sources/AlertContainerScreen.swift +++ b/Samples/AlertContainer/Sources/AlertContainerScreen.swift @@ -30,7 +30,7 @@ public struct AlertContainerScreen: Screen { } public func viewControllerDescription(environment: ViewEnvironment) -> ViewControllerDescription { - return AlertContainerViewController.description(for: self, environment: environment) + AlertContainerViewController.description(for: self, environment: environment) } } @@ -58,8 +58,8 @@ public struct AlertAction { } } -extension AlertAction { - public enum Style { +public extension AlertAction { + enum Style { case `default` case cancel case destructive diff --git a/Samples/AlertContainer/Sources/AlertContainerViewController.swift b/Samples/AlertContainer/Sources/AlertContainerViewController.swift index 1a6011787..a864f540f 100644 --- a/Samples/AlertContainer/Sources/AlertContainerViewController.swift +++ b/Samples/AlertContainer/Sources/AlertContainerViewController.swift @@ -18,13 +18,13 @@ import UIKit import Workflow import WorkflowUI -private struct AlertStyleConstants { +private enum AlertStyleConstants { static let viewWidth: CGFloat = 343.0 static let buttonTitleColor = UIColor(red: 41 / 255, green: 150 / 255, blue: 204 / 255, alpha: 1.0) static let titleFont = UIFont.systemFont(ofSize: 18, weight: .medium) } -internal final class AlertContainerViewController: ScreenViewController> { +final class AlertContainerViewController: ScreenViewController> { private var baseScreenViewController: DescribedViewController private let dimmingView = UIView() @@ -63,7 +63,7 @@ internal final class AlertContainerViewController: ScreenVi baseScreenViewController.update(screen: screen.baseScreen, environment: environment) if let alert = screen.alert { - if let alertView = alertView { + if let alertView { alertView.alert = alert } else { let inAlertView = AlertView(alert: alert) @@ -104,7 +104,7 @@ internal final class AlertContainerViewController: ScreenVi ) } } else { - if let alertView = alertView { + if let alertView { UIView.animate( withDuration: 0.1, delay: 0, @@ -126,23 +126,23 @@ internal final class AlertContainerViewController: ScreenVi } override var childForStatusBarStyle: UIViewController? { - return baseScreenViewController + baseScreenViewController } override var childForStatusBarHidden: UIViewController? { - return baseScreenViewController + baseScreenViewController } override var childForHomeIndicatorAutoHidden: UIViewController? { - return baseScreenViewController + baseScreenViewController } override var childForScreenEdgesDeferringSystemGestures: UIViewController? { - return baseScreenViewController + baseScreenViewController } override public var supportedInterfaceOrientations: UIInterfaceOrientationMask { - return baseScreenViewController.supportedInterfaceOrientations + baseScreenViewController.supportedInterfaceOrientations } } @@ -173,7 +173,7 @@ private final class AlertView: UIView { } private func commonInit() { - guard let alert = alert else { + guard let alert else { return } title.text = alert.title @@ -253,6 +253,7 @@ private final class AlertButton: UIButton { addTarget(self, action: #selector(triggerActionHandler), for: .touchUpInside) } + @available(*, unavailable) required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } diff --git a/Samples/AsyncWorker/Sources/AsyncWorkerWorkflow.swift b/Samples/AsyncWorker/Sources/AsyncWorkerWorkflow.swift index 9bb62d667..a90fcb726 100644 --- a/Samples/AsyncWorker/Sources/AsyncWorkerWorkflow.swift +++ b/Samples/AsyncWorker/Sources/AsyncWorkerWorkflow.swift @@ -22,7 +22,7 @@ extension AsyncWorkerWorkflow { } func makeInitialState() -> AsyncWorkerWorkflow.State { - return State(model: Model(message: "Initial State")) + State(model: Model(message: "Initial State")) } func workflowDidChange(from previousWorkflow: AsyncWorkerWorkflow, state: inout State) {} diff --git a/Samples/AsyncWorker/Sources/FakeNetwork/FakeNetworkManager.swift b/Samples/AsyncWorker/Sources/FakeNetwork/FakeNetworkManager.swift index 60669614b..b6a40b1c1 100644 --- a/Samples/AsyncWorker/Sources/FakeNetwork/FakeNetworkManager.swift +++ b/Samples/AsyncWorker/Sources/FakeNetwork/FakeNetworkManager.swift @@ -9,7 +9,7 @@ import Foundation class FakeNetworkManager { static func makeFakeNetworkRequest() -> FakeRequest { - return FakeRequest() + FakeRequest() } } diff --git a/Samples/AsyncWorker/Sources/FakeNetwork/Model.swift b/Samples/AsyncWorker/Sources/FakeNetwork/Model.swift index 833347a08..01bdb42f5 100644 --- a/Samples/AsyncWorker/Sources/FakeNetwork/Model.swift +++ b/Samples/AsyncWorker/Sources/FakeNetwork/Model.swift @@ -1,5 +1,5 @@ // -// FakeModel.swift +// Model.swift // AsyncWorker // // Created by Mark Johnson on 6/16/22. diff --git a/Samples/BackStackContainer/Sources/BackStackContainer.swift b/Samples/BackStackContainer/Sources/BackStackContainer.swift index 6293d0b72..89abfc48c 100644 --- a/Samples/BackStackContainer/Sources/BackStackContainer.swift +++ b/Samples/BackStackContainer/Sources/BackStackContainer.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import WorkflowUI import UIKit +import WorkflowUI public final class BackStackContainer: ScreenViewController>, UINavigationControllerDelegate { private let navController = UINavigationController() @@ -69,14 +69,12 @@ public final class BackStackContainer: ScreenViewController