* Update TestStore to support imperative DSL
This gives us better XCTIssue-based error messaging since each line is
captured in the stack.
* Update examples to new testing DSL
* Fix
* Update README.md
* 11.3
* fix
* fix
* Addresses a couple of documentation issues for IdentifiedArray:
1. The AppState example is missing a generic. Based on the context of the documentation, I filled that into what I thought would be appropriate.
2. The ForEachStore example was missing a colon and comma.
* Update Sources/ComposableArchitecture/SwiftUI/IdentifiedArray.swift
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
* 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>
* Forms
* wip
* wip
* Basics
* Fix
* Apply .textCase(.none) to section headeres.
* Small tweaks do docs and case study readme.
* Update Forms.swift
* Fix warnings
* Revert "Apply .textCase(.none) to section headeres."
This reverts commit f535a75eb9.
* fix
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
* Explicitly define `objectWillChange` on `ViewStore`.
Because the `ViewStore` no longer uses `@Published` variables, the
conformance to `ObservableObject` no longer sythesizes the
`objectWillChange` property on `ViewStore` in iOS 13.0 or 13.1.
This caused `ViewStore` changes to not propagate, leading to views never
updating on these OS versions. This fixes issues #334 and (the already
closed) #238.
* Apply suggestions from code review
* Update Sources/ComposableArchitecture/ViewStore.swift
Co-authored-by: Stephen Celis <stephen.celis@gmail.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`