Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8a03e6a
wip
stephencelis Sep 13, 2024
3fe6fb0
wip
stephencelis Sep 13, 2024
9122a3a
wip
stephencelis Sep 13, 2024
f80cb3b
wip
stephencelis Sep 13, 2024
f67562a
wip
stephencelis Sep 13, 2024
2bd4f44
wip
stephencelis Sep 13, 2024
00ad75e
wip
stephencelis Sep 13, 2024
65c42e1
wip
stephencelis Sep 13, 2024
e79668e
wip
stephencelis Sep 13, 2024
0665585
wip
stephencelis Sep 13, 2024
a5e7734
wip
stephencelis Sep 13, 2024
0d630e2
wip
stephencelis Sep 13, 2024
edbf4e6
wip
stephencelis Sep 13, 2024
0ae2e54
Merge remote-tracking branch 'origin/main' into core
stephencelis Sep 13, 2024
26e41f9
wip
stephencelis Sep 13, 2024
f4da4c6
wip
stephencelis Sep 13, 2024
33cc53e
wip
stephencelis Sep 13, 2024
052841e
wip
stephencelis Sep 13, 2024
e34e628
wip
stephencelis Sep 13, 2024
712fa8d
wip
stephencelis Sep 14, 2024
d9eb1f6
wip
stephencelis Sep 14, 2024
603d725
Merge remote-tracking branch 'origin/main' into core
stephencelis Sep 19, 2024
62a61c3
get rid of originating action
mbrandonw Sep 27, 2024
c70426f
wip
stephencelis Oct 2, 2024
bef3861
Merge remote-tracking branch 'origin/main' into core
stephencelis Oct 8, 2024
e58cba5
Merge remote-tracking branch 'origin/main' into core
stephencelis Oct 16, 2024
c3338b5
Merge remote-tracking branch 'origin/main' into core
stephencelis Oct 21, 2024
413c24c
Merge branch 'main' into core
stephencelis Nov 12, 2024
bbe33b7
Merge remote-tracking branch 'origin/main' into core
stephencelis Feb 6, 2025
47d606b
Merge remote-tracking branch 'origin/main' into core
stephencelis Feb 27, 2025
58fddea
Merge remote-tracking branch 'origin/main' into core
stephencelis Feb 27, 2025
1b7f72c
wip
stephencelis Feb 28, 2025
5714403
Merge remote-tracking branch 'origin/main' into core
stephencelis Mar 13, 2025
95570eb
Deprecate non-writable scopes
stephencelis Mar 13, 2025
31b0755
Revert "Deprecate non-writable scopes"
stephencelis Mar 13, 2025
f05ac83
Merge branch 'main' into core
stephencelis Mar 26, 2025
725189d
wip
stephencelis Mar 26, 2025
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
Prev Previous commit
Next Next commit
wip
  • Loading branch information
stephencelis committed Sep 13, 2024
commit f4da4c639b12f9a584e509e7e3b7db805510913d
196 changes: 98 additions & 98 deletions Sources/ComposableArchitecture/SwiftUI/Deprecated/ActionSheet.swift
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
//import SwiftUI
//
//extension View {
// /// Displays an action sheet when the store's state becomes non-`nil`, and dismisses it when it
// /// becomes `nil`.
// ///
// /// - Parameters:
// /// - store: A store that is focused on ``PresentationState`` and ``PresentationAction`` for an
// /// alert.
// /// - toDestinationState: A transformation to extract alert state from the presentation state.
// /// - fromDestinationAction: A transformation to embed alert actions into the presentation
// /// action.
// @available(
// iOS,
// introduced: 13,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:)' instead."
// )
// @available(macOS, unavailable)
// @available(
// tvOS,
// introduced: 13,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:)' instead."
// )
// @available(
// watchOS,
// introduced: 6,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:)' instead."
// )
// #if swift(<5.10)
// @MainActor(unsafe)
// #else
// @preconcurrency@MainActor
// #endif
// public func actionSheet<ButtonAction>(
// store: Store<
// PresentationState<ConfirmationDialogState<ButtonAction>>, PresentationAction<ButtonAction>
// >
// ) -> some View {
// self.actionSheet(store: store, state: { $0 }, action: { $0 })
// }
//
// /// Displays an alert when the store's state becomes non-`nil`, and dismisses it when it becomes
// /// `nil`.
// ///
// /// - Parameters:
// /// - store: A store that is focused on ``PresentationState`` and ``PresentationAction`` for an
// /// alert.
// /// - toDestinationState: A transformation to extract alert state from the presentation state.
// /// - fromDestinationAction: A transformation to embed alert actions into the presentation
// /// action.
// @available(
// iOS,
// introduced: 13,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:state:action:)' instead."
// )
// @available(macOS, unavailable)
// @available(
// tvOS,
// introduced: 13,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:state:action:)' instead."
// )
// @available(
// watchOS,
// introduced: 6,
// deprecated: 100000,
// message: "use 'View.confirmationDialog(store:state:action:)' instead."
// )
// #if swift(<5.10)
// @MainActor(unsafe)
// #else
// @preconcurrency@MainActor
// #endif
// public func actionSheet<State, Action, ButtonAction>(
// store: Store<PresentationState<State>, PresentationAction<Action>>,
// state toDestinationState: @escaping (_ state: State) -> ConfirmationDialogState<ButtonAction>?,
// action fromDestinationAction: @escaping (_ alertAction: ButtonAction) -> Action
// ) -> some View {
// self.presentation(
// store: store, state: toDestinationState, action: fromDestinationAction
// ) { `self`, $item, _ in
// let actionSheetState = store.withState { $0.wrappedValue.flatMap(toDestinationState) }
// self.actionSheet(item: $item) { _ in
// ActionSheet(actionSheetState!) { action in
// if let action {
// store.send(.presented(fromDestinationAction(action)))
// } else {
// store.send(.dismiss)
// }
// }
// }
// }
// }
//}
import SwiftUI

extension View {
/// Displays an action sheet when the store's state becomes non-`nil`, and dismisses it when it
/// becomes `nil`.
///
/// - Parameters:
/// - store: A store that is focused on ``PresentationState`` and ``PresentationAction`` for an
/// alert.
/// - toDestinationState: A transformation to extract alert state from the presentation state.
/// - fromDestinationAction: A transformation to embed alert actions into the presentation
/// action.
@available(
iOS,
introduced: 13,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:)' instead."
)
@available(macOS, unavailable)
@available(
tvOS,
introduced: 13,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:)' instead."
)
@available(
watchOS,
introduced: 6,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:)' instead."
)
#if swift(<5.10)
@MainActor(unsafe)
#else
@preconcurrency@MainActor
#endif
public func actionSheet<ButtonAction>(
store: Store<
PresentationState<ConfirmationDialogState<ButtonAction>>, PresentationAction<ButtonAction>
>
) -> some View {
self.actionSheet(store: store, state: { $0 }, action: { $0 })
}

/// Displays an alert when the store's state becomes non-`nil`, and dismisses it when it becomes
/// `nil`.
///
/// - Parameters:
/// - store: A store that is focused on ``PresentationState`` and ``PresentationAction`` for an
/// alert.
/// - toDestinationState: A transformation to extract alert state from the presentation state.
/// - fromDestinationAction: A transformation to embed alert actions into the presentation
/// action.
@available(
iOS,
introduced: 13,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:state:action:)' instead."
)
@available(macOS, unavailable)
@available(
tvOS,
introduced: 13,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:state:action:)' instead."
)
@available(
watchOS,
introduced: 6,
deprecated: 100000,
message: "use 'View.confirmationDialog(store:state:action:)' instead."
)
#if swift(<5.10)
@MainActor(unsafe)
#else
@preconcurrency@MainActor
#endif
public func actionSheet<State, Action, ButtonAction>(
store: Store<PresentationState<State>, PresentationAction<Action>>,
state toDestinationState: @escaping (_ state: State) -> ConfirmationDialogState<ButtonAction>?,
action fromDestinationAction: @escaping (_ alertAction: ButtonAction) -> Action
) -> some View {
self.presentation(
store: store, state: toDestinationState, action: fromDestinationAction
) { `self`, $item, _ in
let actionSheetState = store.withState { $0.wrappedValue.flatMap(toDestinationState) }
self.actionSheet(item: $item) { _ in
ActionSheet(actionSheetState!) { action in
if let action {
store.send(.presented(fromDestinationAction(action)))
} else {
store.send(.dismiss)
}
}
}
}
}
}