Commit Graph

305 Commits

Author SHA1 Message Date
mbrandonw
e043226f3d Run swift-format 2021-06-14 18:15:34 +00:00
Wendy Liga
1a8bccc62e Support DocC Xcode 13 (#591)
* wip

* finish

* revert back code snippet identation to 5

* Update Sources/ComposableArchitecture/Effect.swift

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
2021-06-14 14:10:08 -04:00
Stephen Celis
c99a2f9636 Update Tic-Tac-Toe to use enum state (#595)
* Update Tic-Tac-Toe to use enum state

* wip

* more swift compatability changes

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-06-14 12:39:39 -04:00
mbrandonw
e1c0a52897 Run swift-format 2021-06-14 14:53:01 +00:00
Brandon Williams
3d8db944c7 Add SwitchStore and CaseLet (#594)
* wip

* ttt

* simplfiy

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* docs

* wip

* wip

* wip

* wip

* wip

* updates

* revert ttt stuff'

* xcode 11 fixes

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2021-06-14 10:46:36 -04:00
stephencelis
155e031dd7 Run swift-format 2021-06-01 17:02:26 +00:00
Stephen Celis
dc3576bbd8 Only breakpoint when debugger is attached (#579)
* Only breakpoint when debugger is attached

* Update Breakpoint.swift

* Add breakpoint instruction
2021-06-01 09:46:31 -07:00
Stephen Celis
6eb7ca5d48 Remove convenience initializer on Store (#572) 2021-05-26 13:33:34 -07:00
Danny Hertz
440e9c48b2 Cancel in flight timers with the same id (#536) 2021-05-10 07:33:02 -07:00
Stephen Celis
37537a5248 Fix ForEachStore (#528) 2021-05-05 07:57:37 -07:00
Brandon Williams
468ffaa9ea Fix typo in AlertState docs (#520) 2021-04-29 08:09:33 -05:00
Brandon Williams
6146345c18 Add a few more store tests. (#516)
* Add a few more store tests.

* wip

* wip

* tweaks

* wip
2021-04-28 17:06:55 -05:00
Stephen Celis
0f026d395d Update Store.ifLet docs (#500)
* Update `Store.ifLet` docs

* More docs

* Update syntax for old CI

* fix
2021-04-20 11:36:14 -04:00
Stephen Celis
c53a961920 Add @ViewBuilder to ForEachStore and IfLetStore (#501)
* Add @ViewBuilder to ForEachStore and IfLetStore

* Update IfLetStore else branch to take view builder
2021-04-20 11:10:30 -04:00
Michael Brown
ba2b9e08e2 Clarify docs for UIKit ifLet function (#497)
* Clarify docs for UIKit

* Add clarification to override also
2021-04-20 09:00:34 -04:00
Brandon Williams
4ea3dfed61 Work around Combine-related crash on iOS 13 (#483)
* Fix Combine crash for iOS 13.

* Clean up

* remove scheme
2021-04-08 08:18:36 -07:00
stephencelis
dcf6b8f469 Run swift-format 2021-04-05 18:30:47 +00:00
Stephen Celis
4e2b27b492 Safely unwrap ForEachStore rows (#471)
* Safely unwrap ForEachStore rows

* Add feedback link
2021-04-05 14:15:36 -04:00
Stephen Celis
84b9a00438 Failing Effects (#453) 2021-03-22 13:54:52 -04:00
Stephen Celis
f1faccc3a2 Updated TestStore DSL (#454)
* 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
2021-03-22 13:27:51 -04:00
Krzysztof Siejkowski
1d1ce31471 Convenience initialised for stateless ViewStore (#349) 2021-03-19 11:48:55 -04:00
Stephen Celis
e45b7ecc03 Remove old Effect.fireAndForget() (#430)
* Update Effect.swift

* Update Effect.swift

* Update Effect.swift
2021-03-15 11:08:28 -04:00
stephencelis
5a4a9d5005 Run swift-format 2021-03-15 14:35:31 +00:00
Stephen Celis
2e6d34e26d Add more permissive fire-and-forget effect (#427)
* Add more permissive fire-and-forget effect

* Update Effect.swift

* Update Effect.swift
2021-03-15 10:27:56 -04:00
stephencelis
9e50df4427 Run swift-format 2021-03-10 23:02:03 +00:00
Stephen Celis
cb080b7478 TextState: DebugOutputConvertible (#421)
* Fix debug text

* XML

* wip

* wip

* wip
2021-03-10 17:56:13 -05:00
Steven Sherry
a116fff6d4 Addresses a couple of documentation issues for IdentifiedArray (#414)
* 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>
2021-03-06 12:16:32 -05:00
Stephen Celis
e935270972 Tie long-living effect assertions to line of originating action (#413)
* Tie long-living effect assertions to line of originating action

* Fix

* fix

* More CI
2021-03-05 12:34:25 -05:00
Stephen Celis
f8608c7421 Breakpoint instead of assert in optional/forEach (#296)
* 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>
2021-03-02 13:03:15 -05:00
Stephen Celis
caebd33686 Add ViewStore.send(_:animation:). (#392) 2021-02-22 15:31:25 -05:00
Jason Clark
e22776f7fd Adds .sequence(Step) to StepType (#387) 2021-02-17 15:50:26 -05:00
Stephen Celis
97c3dab5c3 Improve performance of ForEachStore (#386)
* Improve performance of ForEachStore

* fix

* Fix

* Cleanup

* Basic docs

* Update ForEachStore.swift
2021-02-15 13:43:56 -05:00
Stephen Celis
5bdf0bc904 FormAction → BindingAction (#372)
* Rename FormAction to BindingAction

* Deprecations

* Fix test

* Update 01-GettingStarted-Bindings-Forms.swift
2021-02-01 16:41:36 -05:00
Stephen Celis
e51fb00d1f Remove type alias for Xcode 12.5 compatibility (#371)
* Remove type alias

* Fix a few warnings
2021-02-01 14:55:29 -05:00
Stephen Celis
636f3facdc Document scope a bit more deeply (#360) 2021-02-01 14:46:35 -05:00
Stephen Celis
b07596068f Fatal error replacing identified elements with invalid ids (#368)
* Fatal error replacing identified elements with invalid ids

Fixes #366.

* cleanup

* fix
2021-02-01 14:45:44 -05:00
stephencelis
adf5024ceb Run swift-format 2021-02-01 18:44:48 +00:00
Stephen Celis
ff57565322 Forms (#367)
* 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>
2021-02-01 13:34:55 -05:00
Stephen Celis
a8a5bcec1d Re-publicize AlertState.Button.type (#361)
* Re-publicize `AlertState.Button.type`

* Update Alert.swift
2021-01-22 10:24:31 -05:00
stephencelis
37c6312ba4 Run swift-format 2021-01-21 23:12:17 +00:00
Stephen Celis
4449bc2e24 Add TextState (for AlertState, ActionSheetState, etc.) (#359)
* Use SwiftUI.Text with {Alert,ActionSheet}State

Fix #293, #318.

* Use public interface

* Availability

* TextState

* Note

* Simplify

* Update LocalizedStringTests.swift

* Fix warnings

* Fix docs
2021-01-21 17:50:34 -05:00
Nick Sillik
3ab944e6aa Explicitly define objectWillChange on ViewStore. (#353)
* 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>
2021-01-18 17:09:44 -05:00
SteinerHannes
607ea20ff6 Update Reducer.swift (#332) 2021-01-12 09:47:59 -05:00
Stephen Celis
4c7bd31336 Format and coverage 2021-01-12 09:45:48 -05:00
stephencelis
b1e2dced5b Run swift-format 2021-01-12 00:51:35 +00:00
Max Desiatov
9fbd834664 Add Scene conformance to WithViewStore (#336)
* 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`
2021-01-11 19:38:09 -05:00
Stephen Celis
f6c73e65b8 Only include actions in TestStore debug output (#342) 2021-01-11 16:43:10 -05:00
Jans Pavlovs
81e61f8f9c Replace deprecated optional with optional() (#339) 2021-01-11 09:21:54 -05:00
Stephen Celis
2b8fb04782 Fix Binding animations (#338) 2021-01-08 14:08:39 -05:00
Brandon Williams
c1f88bd860 Fix docs for ViewStore.binding overload. (#321)
* Fix docs for ViewStore.binding overload.

* wip

* Update Sources/ComposableArchitecture/ViewStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2020-11-15 17:38:43 -05:00