Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeep: Remove legacy files and polish the Coordinator API #27

Merged
merged 5 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
ssestak marked this conversation as resolved.
Show resolved Hide resolved
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.

Loading