* Conform `WithViewStore` to `Commands`
* Fix typo
* Add coverage for `Commands`
* Fix documentation
* Conform `WithViewStore` to `AccessibilityRotorContent` and `ToolbarContent`
* Conform `WithViewStore` to `TableColumnContent`
* Fix indentation
* Conform `WithViewStore` to `TableRowContent`
* Fix Typo
* Conform `WithViewStore` to `DynamicTableRowContent`
* Reorder declarations according to the protocol name
* Add coverage for `WithViewStore` new conformances
* Remove Table-related conformances
* Rearrange extensions for better autocomplete.
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
* Use a new instance of `ViewStore` in `WithViewStore`'s `body`
* Use explicit `self` for style coherence
* Remove `viewCancellable` additional reference in `newInstance()`
* Revert "Remove `viewCancellable` additional reference in `newInstance()`"
This reverts commit cb6a22ae4f.
* Change `viewCancellable` capture list
* Update `GeometryReader`'s workarounds
* Breakpoint instead of assert in optional/forEach
* fix merge
Co-authored-by: Brandon Williams <mbw234@gmail.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
* Add SceneWithViewStore for accessing stores in scenes
This would allow accessing `ViewStore` instances from a `body` definition of a type conforming to `Scene`. It could be useful for conditional rendering of scenes or sending actions from scene commands. Here's an example:
```swift
import ComposableArchitecture
import SwiftUI
@main
struct CommandsApp: App {
private let store = Store(
initialState: RootState(),
reducer: rootReducer,
environment: .live(rootEnvironment)
)
var body: some Scene {
SceneWithViewStore(store) { viewStore in
WindowGroup {
WorkspaceView()
}.commands {
CommandGroup(after: CommandGroupPlacement.newItem) {
Button("Open...") {
viewStore.send(.open)
}.keyboardShortcut("o", modifiers: [.command])
}
}
}
}
}
```
* Avoid building SceneWithViewStore with old Xcode
* Separate Catalina and Big Sur jobs
This allows testing APIs that are only available on Big Sur
* Unify `WithViewStore` and `SceneWithViewStore`