7 Commits

Author SHA1 Message Date
stephencelis
97b7ebb018 Run swift-format 2024-08-27 19:39:04 +00:00
Stephen Celis
0d8980f5bc Swift 6: Main actor isolated store view helpers (#3283)
* `@preconcurrency @MainActor` isolation of `Store`

* Remove unneeded `@MainActor`s

* Remove thread checking code

* Remove unneeded `@MainActor`s

* Swift 5.10 compatibility fixes

* wip

* More 5.10 fixes

* wip

* fixes

* wip

* wip

* up the timeout

* wip

* Fixes

* wip

* wip

* wip

* wip

* wip

* wip

* Main actor logger

* wip

* wip

* wip

* fix

* fix

* fix

* fix compilation error

* wip

* wip

* bring back yield

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2024-08-27 12:31:43 -07:00
Malte Bünz
3f16c6c927 fix typo (#3268) 2024-08-02 09:31:29 -04:00
Stephen Celis
2c3453cb79 Some cleanup (#2759)
* Some cleanup

  - `if/guard let x = x` -> `if/guard let x`
  - Remove unneeded `self` from a few demos
  - Fix up some presentation logic in TicTacToe

* Update Examples/TicTacToe/tic-tac-toe/Sources/LoginUIKit/LoginViewController.swift

* wip

* wip

* wip
2024-02-01 15:43:52 -08:00
Stephen Celis
5ba7943402 Internal: rename Store.{state,stateSubject} (#2538)
* Internal: rename `Store.{state,stateSubject}`

Both an internal readability win and will make it easier to provide a
public `state` property in the future.

* wip
2023-10-31 14:45:57 -07:00
stephencelis
356be6a9c2 Run swift-format 2023-08-18 17:35:12 +00:00
Stephen Celis
93fa026cbc Re-introduce legacy alert and action sheet APIs (#2379)
* Re-introduce legacy alert and action sheet APIs

With 1.0 we removed `View.alert(_ store:dismiss:)`, which was a
problematic API. It used different SwiftUI alert APIs depending on OS
version, which led to different runtime behavior for apps using it
depending on the OS and an unfixable bug:

https://github.com/pointfreeco/swift-composable-architecture/issues/1981

This was reason enough to remove the API, but it was also an API that
predated the Composable Architecture's navigation tools. This meant it
awkwardly took an explicit `dismiss:` action, and it was up to the
developer to remember to use this action to manually clear out state.
The Composable Architecture's navigation tools handle dismissal
automatically once integrated, but also only support iOS 15 alerts at
the moment.

This PR addresses the above: it introduces view modifiers for the old
iOS 13 style of alert (and `actionSheet`) providing some presentation
domain, and it will automatically dismiss these modals accordingly:

  - It adds `View.legacyAlert(store:)`. While we don't love
    `legacyAlert`, we haven't come up with a better option. We need a
    statically unique view modifier, and `alert(store:)` is already in
    use for iOS 15. We're open to suggestions here, though!

  - It adds `View.actionSheet(store:)`.

* wip
2023-08-18 10:34:27 -07:00