Some small fixes (#31)

* Some small fixes

* wip
This commit is contained in:
Brandon Williams 2022-11-21 15:10:57 -05:00 committed by GitHub
parent 37eb93f853
commit 8db42e81f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 22 deletions

View File

@ -18,7 +18,7 @@ jobs:
runs-on: macos-12 runs-on: macos-12
strategy: strategy:
matrix: matrix:
xcode: ['14.1'] xcode: ['13.4.1', '14.1']
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -14,6 +14,10 @@ let package = Package(
.library( .library(
name: "SwiftUINavigation", name: "SwiftUINavigation",
targets: ["SwiftUINavigation"] targets: ["SwiftUINavigation"]
),
.library(
name: "_SwiftUINavigationState",
targets: ["_SwiftUINavigationState"]
) )
], ],
dependencies: [ dependencies: [

View File

@ -3,12 +3,12 @@
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) @available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
extension View { extension View {
/// Pushes a view onto a `NavigationStack` using a binding as a data source for the destination's /// Pushes a view onto a `NavigationStack` using a binding as a data source for the
/// content. /// destination's content.
/// ///
/// This is a version of SwiftUI's `navigationDestination(isPresented:)` modifier, but powered by /// This is a version of SwiftUI's `navigationDestination(isPresented:)` modifier, but powered
/// a binding to optional state instead of a binding to a boolean. When state becomes non-`nil`, /// by a binding to optional state instead of a binding to a boolean. When state becomes
/// a _binding_ to the unwrapped value is passed to the destination closure. /// non-`nil`, a _binding_ to the unwrapped value is passed to the destination closure.
/// ///
/// ```swift /// ```swift
/// struct TimelineView: View { /// struct TimelineView: View {
@ -32,11 +32,11 @@
/// ///
/// - Parameters: /// - Parameters:
/// - value: A binding to an optional source of truth for the destination. When `value` is /// - value: A binding to an optional source of truth for the destination. When `value` is
/// non-`nil`, a non-optional binding to the value is passed to the `destination` closure. You /// non-`nil`, a non-optional binding to the value is passed to the `destination` closure.
/// use this binding to produce content that the system pushes to the user in a navigation /// You use this binding to produce content that the system pushes to the user in a
/// stack. Changes made to the destination's binding will be reflected back in the source of /// navigation stack. Changes made to the destination's binding will be reflected back in
/// truth. Likewise, changes to `value` are instantly reflected in the destination. If `value` /// the source of truth. Likewise, changes to `value` are instantly reflected in the
/// becomes `nil`, the destination is popped. /// destination. If `value` becomes `nil`, the destination is popped.
/// - destination: A closure returning the content of the destination. /// - destination: A closure returning the content of the destination.
public func navigationDestination<Value, Destination: View>( public func navigationDestination<Value, Destination: View>(
unwrapping value: Binding<Value?>, unwrapping value: Binding<Value?>,
@ -50,20 +50,20 @@
) )
} }
/// Pushes a view onto a `NavigationStack` using a binding and case path as a data source for the /// Pushes a view onto a `NavigationStack` using a binding and case path as a data source for
/// destination's content. /// the destination's content.
/// ///
/// A version of `View.navigationDestination(unwrapping:)` that works with enum state. /// A version of `View.navigationDestination(unwrapping:)` that works with enum state.
/// ///
/// - Parameters: /// - Parameters:
/// - enum: A binding to an optional enum that holds the source of truth for the destination at /// - enum: A binding to an optional enum that holds the source of truth for the destination
/// a particular case. When `enum` is non-`nil`, and `casePath` successfully extracts a value, /// at a particular case. When `enum` is non-`nil`, and `casePath` successfully extracts a
/// a non-optional binding to the value is passed to the `content` closure. You use this /// value, a non-optional binding to the value is passed to the `content` closure. You use
/// binding to produce content that the system pushes to the user in a navigation stack. /// this binding to produce content that the system pushes to the user in a navigation
/// Changes made to the destination's binding will be reflected back in the source of truth. /// stack. Changes made to the destination's binding will be reflected back in the source of
/// Likewise, changes to `enum` at the given case are instantly reflected in the destination. /// truth. Likewise, changes to `enum` at the given case are instantly reflected in the
/// If `enum` becomes `nil`, or becomes a case other than the one identified by `casePath`, /// destination. If `enum` becomes `nil`, or becomes a case other than the one identified by
/// the destination is popped. /// `casePath`, the destination is popped.
/// - casePath: A case path that identifies a case of `enum` that holds a source of truth for /// - casePath: A case path that identifies a case of `enum` that holds a source of truth for
/// the destination. /// the destination.
/// - destination: A closure returning the content of the destination. /// - destination: A closure returning the content of the destination.

View File

@ -317,7 +317,7 @@ extension ConfirmationDialogState {
} }
@available(iOS, introduced: 13, deprecated: 100000, renamed: "ConfirmationDialogState") @available(iOS, introduced: 13, deprecated: 100000, renamed: "ConfirmationDialogState")
@available(macOS, unavailable) @available(macOS, introduced: 12, unavailable)
@available(tvOS, introduced: 13, deprecated: 100000, renamed: "ConfirmationDialogState") @available(tvOS, introduced: 13, deprecated: 100000, renamed: "ConfirmationDialogState")
@available(watchOS, introduced: 6, deprecated: 100000, renamed: "ConfirmationDialogState") @available(watchOS, introduced: 6, deprecated: 100000, renamed: "ConfirmationDialogState")
public typealias ActionSheetState<Action> = ConfirmationDialogState<Action> public typealias ActionSheetState<Action> = ConfirmationDialogState<Action>
@ -331,6 +331,7 @@ public typealias ActionSheetState<Action> = ConfirmationDialogState<Action>
) )
@available( @available(
macOS, macOS,
introduced: 12,
unavailable unavailable
) )
@available( @available(