parent
37eb93f853
commit
8db42e81f6
|
@ -18,7 +18,7 @@ jobs:
|
|||
runs-on: macos-12
|
||||
strategy:
|
||||
matrix:
|
||||
xcode: ['14.1']
|
||||
xcode: ['13.4.1', '14.1']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
@ -14,6 +14,10 @@ let package = Package(
|
|||
.library(
|
||||
name: "SwiftUINavigation",
|
||||
targets: ["SwiftUINavigation"]
|
||||
),
|
||||
.library(
|
||||
name: "_SwiftUINavigationState",
|
||||
targets: ["_SwiftUINavigationState"]
|
||||
)
|
||||
],
|
||||
dependencies: [
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
|
||||
extension View {
|
||||
/// Pushes a view onto a `NavigationStack` using a binding as a data source for the destination's
|
||||
/// content.
|
||||
/// Pushes a view onto a `NavigationStack` using a binding as a data source for the
|
||||
/// destination's content.
|
||||
///
|
||||
/// This is a version of SwiftUI's `navigationDestination(isPresented:)` modifier, but powered by
|
||||
/// a binding to optional state instead of a binding to a boolean. When state becomes non-`nil`,
|
||||
/// a _binding_ to the unwrapped value is passed to the destination closure.
|
||||
/// This is a version of SwiftUI's `navigationDestination(isPresented:)` modifier, but powered
|
||||
/// by a binding to optional state instead of a binding to a boolean. When state becomes
|
||||
/// non-`nil`, a _binding_ to the unwrapped value is passed to the destination closure.
|
||||
///
|
||||
/// ```swift
|
||||
/// struct TimelineView: View {
|
||||
|
@ -32,11 +32,11 @@
|
|||
///
|
||||
/// - Parameters:
|
||||
/// - 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
|
||||
/// use this binding to produce content that the system pushes to the user in a navigation
|
||||
/// stack. Changes made to the destination's binding will be reflected back in the source of
|
||||
/// truth. Likewise, changes to `value` are instantly reflected in the destination. If `value`
|
||||
/// becomes `nil`, the destination is popped.
|
||||
/// non-`nil`, a non-optional binding to the value is passed to the `destination` closure.
|
||||
/// You use this binding to produce content that the system pushes to the user in a
|
||||
/// navigation stack. Changes made to the destination's binding will be reflected back in
|
||||
/// the source of truth. Likewise, changes to `value` are instantly reflected in the
|
||||
/// destination. If `value` becomes `nil`, the destination is popped.
|
||||
/// - destination: A closure returning the content of the destination.
|
||||
public func navigationDestination<Value, Destination: View>(
|
||||
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
|
||||
/// destination's content.
|
||||
/// Pushes a view onto a `NavigationStack` using a binding and case path as a data source for
|
||||
/// the destination's content.
|
||||
///
|
||||
/// A version of `View.navigationDestination(unwrapping:)` that works with enum state.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - enum: A binding to an optional enum that holds the source of truth for the destination at
|
||||
/// a particular case. When `enum` is non-`nil`, and `casePath` successfully extracts a value,
|
||||
/// a non-optional binding to the value is passed to the `content` closure. You use this
|
||||
/// binding to produce content that the system pushes to the user in a navigation stack.
|
||||
/// Changes made to the destination's binding will be reflected back in the source of truth.
|
||||
/// Likewise, changes to `enum` at the given case are instantly reflected in the destination.
|
||||
/// If `enum` becomes `nil`, or becomes a case other than the one identified by `casePath`,
|
||||
/// the destination is popped.
|
||||
/// - enum: A binding to an optional enum that holds the source of truth for the destination
|
||||
/// at a particular case. When `enum` is non-`nil`, and `casePath` successfully extracts a
|
||||
/// value, a non-optional binding to the value is passed to the `content` closure. You use
|
||||
/// this binding to produce content that the system pushes to the user in a navigation
|
||||
/// stack. Changes made to the destination's binding will be reflected back in the source of
|
||||
/// truth. Likewise, changes to `enum` at the given case are instantly reflected in the
|
||||
/// destination. If `enum` becomes `nil`, or becomes a case other than the one identified by
|
||||
/// `casePath`, the destination is popped.
|
||||
/// - casePath: A case path that identifies a case of `enum` that holds a source of truth for
|
||||
/// the destination.
|
||||
/// - destination: A closure returning the content of the destination.
|
||||
|
|
|
@ -317,7 +317,7 @@ extension 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(watchOS, introduced: 6, deprecated: 100000, renamed: "ConfirmationDialogState")
|
||||
public typealias ActionSheetState<Action> = ConfirmationDialogState<Action>
|
||||
|
@ -331,6 +331,7 @@ public typealias ActionSheetState<Action> = ConfirmationDialogState<Action>
|
|||
)
|
||||
@available(
|
||||
macOS,
|
||||
introduced: 12,
|
||||
unavailable
|
||||
)
|
||||
@available(
|
||||
|
|
Loading…
Reference in New Issue