Skip to content

Commit

Permalink
Merge pull request #27 from futuredapp/feature/architecture-cleaning
Browse files Browse the repository at this point in the history
Housekeep: Remove legacy files and polish the Coordinator API
  • Loading branch information
mikolasstuchlik authored Aug 23, 2024
2 parents 28288d2 + 8d31f61 commit 89a3d37
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 285 deletions.
5 changes: 4 additions & 1 deletion Sources/FuturedArchitecture/Architecture/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public protocol Coordinator: ObservableObject {
@ViewBuilder
static func rootView(with instance: Self) -> RootView

@MainActor
var modalCover: ModalCoverModel<Destination>? { get set }

@ViewBuilder
Expand All @@ -19,7 +20,7 @@ public protocol Coordinator: ObservableObject {
}

public extension Coordinator {
func present(modal destination: Destination, type: ModalCoverModel<Destination>.Style) {
func present(modal destination: Destination, type: ModalCoverModelStyle) {
switch type {
case .sheet:
Task { @MainActor in
Expand All @@ -46,10 +47,12 @@ public extension Coordinator {
public protocol TabCoordinator: Coordinator {
associatedtype Tab: Hashable

@MainActor
var selectedTab: Tab { get set }
}

public protocol NavigationStackCoordinator: Coordinator {
@MainActor
var path: [Destination] { get set }
}

Expand Down
20 changes: 10 additions & 10 deletions Sources/FuturedArchitecture/Architecture/ModalCoverModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

import Foundation

public struct ModalCoverModel<Destination: Hashable & Identifiable>: Identifiable {
let destination: Destination
let style: Style

public enum Style {
case sheet
#if !os(macOS)
case fullscreenCover
#endif
}
public enum ModalCoverModelStyle {
case sheet
#if !os(macOS)
case fullscreenCover
#endif
}

public struct ModalCoverModel<Destination: Hashable & Identifiable>: Identifiable {
public let destination: Destination
public let style: ModalCoverModelStyle

public var id: Destination.ID {
destination.id
}
Expand Down
35 changes: 0 additions & 35 deletions Sources/FuturedHelpers/Helpers/AnyShape.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public protocol CoordinatorSceneFlowProvider {
var navigateTo: (Destination) -> Void { get }
var pop: () -> Void { get }

var present: ((Destination, ModalCoverModel<Destination>.Style) -> Void)? { get }
var present: ((Destination, ModalCoverModelStyle) -> Void)? { get }
var dismissModal: (() -> Void)? { get }
var onModalDismiss: (() -> Void)? { get }
var popTo: ((Destination?) -> Void)? { get }
Expand Down

This file was deleted.

18 changes: 0 additions & 18 deletions Sources/FuturedHelpers/Helpers/Publisher+Resource.swift

This file was deleted.

18 changes: 0 additions & 18 deletions Sources/FuturedHelpers/Helpers/Publisher+Result.swift

This file was deleted.

49 changes: 0 additions & 49 deletions Sources/FuturedHelpers/Helpers/Resource.swift

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions Tests/FuturedKitTests/Mocks/MockError.swift

This file was deleted.

7 changes: 7 additions & 0 deletions Tests/FuturedKitTests/PlaceholderTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

// We might want to write future test cases in SwiftTesting.
final class PlaceholderTests: XCTestCase {
func testNothing() {
}
}
64 changes: 0 additions & 64 deletions Tests/FuturedKitTests/PublisherResourceTests.swift

This file was deleted.

27 changes: 0 additions & 27 deletions Tests/FuturedKitTests/PublisherResultTests.swift

This file was deleted.

31 changes: 0 additions & 31 deletions Tests/FuturedKitTests/ResourceTests.swift

This file was deleted.

9 changes: 0 additions & 9 deletions Tests/FuturedKitTests/URLTests.swift

This file was deleted.

0 comments on commit 89a3d37

Please sign in to comment.