Commit Graph

242 Commits

Author SHA1 Message Date
Stephen Celis
bef2084cb2 Introduce WithViewStore.init(_:observe:send:...) (#1339)
* wip

* Introduce `WithViewStore.init(_:observe:send:...)`

* Update examples

* wip

* typo

* wip
2022-09-07 10:08:20 -04:00
mbrandonw
3bca5180f3 Run swift-format 2022-08-31 00:09:57 +00:00
Brandon Williams
7b5bc85f2e Update Effect internals to be more efficient. (#1312)
* Distinguish Combine and async effects from each other

* wip

* wip

* wip

* Add some tests

* wip

* wip

* wip

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2022-08-30 19:40:50 -04:00
Brandon Williams
a518935116 Update combine-schedulers and fix implicit Foundation imports. (#1294)
* Update combine-schedulers and fix implicit Foundation imports.

* a few more fixes
2022-08-25 11:58:49 -04:00
유재호
6915844f76 Add final keyword to every test class by default (#1267) 2022-08-15 14:37:30 -04:00
stephencelis
bf6a0bdaf7 Run swift-format 2022-08-08 05:17:33 +00:00
Brandon Williams
108e3a536f Concurrency Beta (#1189)
* more main actor audit

* wip

* wip

* fix

* better task result ==

* task result tests

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix merge conflicts

* wip

* wip

* lots of doc fixes and modernizations

* lots more docs and better hashable conformance for TaskResult

* more docs

* clean up

* more tests and docs

* clean up

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* small clean up

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* explicit

* wip

* fix bug in TestStore.receive

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fixes

* wip

* tools for non-deterministic TestStore.receive

* fix

* wip

* wip

* remove inAnyOrder stuff

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* convert download case study to use async/await

* animations

* fix tests

* remove executor experiment

* wip

* wip

* wip

* wip

* wip

* speech simplification

* wip

* wip

* wip

* wip

* wip

* wip

* add a few todos

* wrote some tests

* simplify speech recognizer

* fix tests

* update some docs about error throwing behavior

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Swift 5.5.2 fixes

* wip

* Bump timeout

* wip

* wip

* Finesse

* proper way to detect main queue

* extra guard

* revert main queue check

* move stuff around

* docs

* fixed a bunch of warnings

* Fix references

* clean up

* clean up

* fix a bunch of warnings

* clean up

* un-soft deprecate concatenate

* async teststore.send

* fix uikit tests

* drop sendable

* wip

* wip

* wip

* wip

* wip

* clean up

* clean up

* reorganize, remove extra task cancellation handler

* wip

* wip

* wip

* wip

* wip

* wip

* Make TestStore.send async (#1190)

* async teststore.send

* fix uikit tests

* Converted all tests to async

* clean up

* added docs

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* docs and readme update

* Update README.md

* Update Tests/ComposableArchitectureTests/StoreTests.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* fix

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/TestStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* clean up

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* wip

* wip

* wip

* make fetchNumber throwing and fix tests

* effect basics clean up

* use local state for isLoading in refreshable case study

* clean up

* fix test

* wip

* wip

* wip

* wip

* wip

* wip

* fixes

* clean up

* clean up

* Simplify

* wip

* clean up

* wip

* AsyncStream.finished()

* give Send a public initializer

* make send public

* temporarily make box public

* remove concurrency flag

* wip

* wip

* wip

* wip

* wip

* docs

* speech

* simplify

* clean up;

* unchecked sendable

* clean up

* clean up

* wip

* docs

* docs

* more docs

* lots of docs

* wip

* wip

* wip

* more docs for streamWithContinuation

* wip

* wip

* wip

* Make internal, too

* wip

* Remove sendability detection

It breaks things, like:

    let request = UncheckedSendable(
      SKProductsRequest(productIdentifiers: []
    )
    // UncheckedSendable<NSObject> // *not* _<SKProductsRequest>

* wip

* doc clean up;

* fixed some todos

* docs

* wip

* remove thread safety FAQ from readme

* fix test

* wip

* docs clean up

* docs clean up

* added a testing article and fixed some docs

* rearrange

* docs clean up

* wip

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* Update Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>

* wip

* wip

* wip

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Thomas Grapperon <35562418+tgrapperon@users.noreply.github.com>
2022-08-08 01:04:16 -04:00
유재호
3f5f3c850f Rename enum Action cases to be consistent (#1240)
* Rename enum Action cases to be consistent

- dissmiss(something)Alert -> (something)AlertDismissed
- rename enum for cancellable id

* Update Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

* Update Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

* Update Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

* Re-alphabetize alertDismissed case

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2022-08-05 13:08:53 -04:00
mbrandonw
0a38f2c860 Run swift-format 2022-07-13 14:17:27 +00:00
Thomas Grapperon
b979b442da Modernize SwiftUI Case Studies (#1208)
* Replace `.navigationBarTitle` by `.navigationTitle`

* Remove .background from Animation

* Update 01-GettingStarted-Bindings-Basics.swift

* Update 01-GettingStarted-Bindings-Forms.swift

* Update 01-GettingStarted-Composition-TwoCounters.swift

* Update 01-GettingStarted-Counter.swift

* Update 01-GettingStarted-FocusState.swift

* Update 01-GettingStarted-OptionalState.swift

* Update 01-GettingStarted-SharedState.swift

* Update 02-Effects-Basics.swift

* Update 02-Effects-Cancellation.swift

* Update 02-Effects-LongLiving.swift

* Update 02-Effects-Refreshable.swift

* Update 02-Effects-Timers.swift

* Update 02-Effects-WebSocket.swift

* Update 02-Effects-SystemEnvironment.swift

* Update 03-Navigation-NavigateAndLoad.swift

* Update 04-HigherOrderReducers-ElmLikeSubscriptions.swift

* Update 04-HigherOrderReducers-Recursion.swift

* Update 04-HigherOrderReducers-ReusableFavoriting.swift

* Update CircularProgressView.swift

* Update DownloadComponent.swift

* Reindent `XCTestDynamicOverlay` block

* Use a dedicated shape for the clock hand

This is a little much simpler I guess.

* Go back to use a Path, much simpler to understand.

* Use more natural modifiers to apply styles

* small updates

* Center the "clocks" horizontally

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2022-07-13 10:08:09 -04:00
Thomas Grapperon
4444dfc4b3 Set the circle in the center of the view in the animation's study (#1203)
* Set the circle in the center of the view in the animation's study

* Modernize Animation study's layout

* Put the gesture back on the Text only
2022-07-12 11:38:19 -04:00
mbrandonw
5c00a09d10 Run swift-format 2022-07-11 23:33:02 +00:00
Brandon Williams
f8128617eb Small updates to animations case study. (#1201) 2022-07-11 19:24:58 -04:00
유재호(예거)
dd5ced35df [SwiftUI Case Studies] Revise initialState and layout in Animations (#1195)
* Remove some unnecessary 'nil' literals in State structs.

* Revise initialState and layout

- move Circle's initial location to center of the screen for better visibility
- align 'circleColor' property's value with actual color using colorInvert()
- remove top margin to display more text because we cannot apply ScrollView in this case

* Update AnimationTests
2022-07-11 15:11:18 -04:00
Stephen Celis
73c2b2f873 Clean up fact client tests (#1172)
* Clean up fact client tests

* wip
2022-06-29 14:03:30 -04:00
Stephen Celis
d1c1b1abf2 Simplify 2022-06-29 13:17:18 -04:00
Stephen Celis
a8f6f79a68 Collapse case study readmes behind disclosure groups (#1171)
* Collapse case study readmes behind disclosure groups

* wip
2022-06-29 12:04:21 -04:00
Stephen Celis
a35359c4d9 scheduler -> mainQueue 2022-06-28 17:16:37 -04:00
Stephen Celis
de2b645b66 Failing -> Unimplemented (#1168) 2022-06-28 16:28:03 -04:00
Brandon Williams
90d91ffedc Clean up compiler checks. (#1167) 2022-06-28 16:05:50 -04:00
Brandon Williams
5bff200c5d Simplify effects basics case study. (#1166)
* Simplify effects basics case study.

* wip

* Update Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Basics.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* nb

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2022-06-28 13:37:59 -04:00
mbrandonw
9a1541aa3a Run swift-format 2022-06-22 17:34:51 +00:00
Stephen Celis
bec0128bae Clean up sample code (#1156)
We employ a few tricks that might be confusing folks that are unfamiliar
with them, so this dials some things down in the sample code and docs.
We could maybe take it further, but this is a start.
2022-06-22 13:19:55 -04:00
Stephen Celis
43449a468f Add more workarounds for disabled field SwiftUI bug (#1147) 2022-06-15 17:41:45 -04:00
Stephen Celis
b8dddaf0bf Clean up generic signatures (#1143) 2022-06-14 09:39:05 -04:00
Brandon Williams
2bedb4b7aa Fix tests in Xcode 14. (#1135)
* Fix tests in Xcode 14.

* wip

* Update download example with proper cancel button.
2022-06-07 08:03:47 -07:00
Stephen Celis
4324761f33 Remove "Strict Reducers" Example (#1116) 2022-05-31 11:14:46 -04:00
Stephen Celis
fb0d371e14 Use eraseToEffect mapping functions (#1102) 2022-05-27 10:41:57 -04:00
Stephen Celis
65401c361a Modernize case study using Notification Center (#1090)
* Use NotificationCenter directly in case study

* wip

* wip
2022-05-12 13:30:11 -04:00
Stephen Celis
c232a9f353 Swift 5.7 fixes (#1089)
* Fix Swift 5.7 warnings

* Fix Swift 5.7 threading issue
2022-05-12 13:07:37 -04:00
Stephen Celis
f0098d8232 Add cancel overloads that take types (#1078)
* Add cancel overloads that take types

* wip
2022-05-03 21:00:24 -04:00
stephencelis
25955ff468 Run swift-format 2022-04-27 04:10:34 +00:00
Tatsuzou Araki
3523af1d91 Fix invalid web socket server URL (#1064) 2022-04-27 00:03:18 -04:00
Thomas Grapperon
1efde6e57a Add icons variants for required resolutions (#1017)
* Add icons variants for required resolutions

* Optimize PNG's size

Even without centralizing the resources, we can already save a few bytes.
The total size was reduced by 75%.

* Replace iTunes variants by a very compact transparent image

This will never hit the AppStore anyway.

* Replace images by lossless optimized variants

The previous optimization pass was lossy. This PR replace images with an optimized lossless variant of the original.

* Restore original iPhone icons

I don't know why images that were supposedly losslessly optimized by ImageOptim were less vibrant than the original.
I restored them by their original variants. Upscaled variants are less vibrant though, but I guess it's acceptable without access to the original vector source.

* Fix color space

ImageOptim seems to change the color space when it optimizes files losslessly.
I've created new variants with Pixelmator Pro and exported as web-compressed from there instead.
2022-03-15 16:15:19 -04:00
stephencelis
d924b9ad27 Run swift-format 2022-03-11 20:52:38 +00:00
bjford
a4ea02e683 Add unit tests to UIKitCaseStudies (#1002) 2022-03-11 15:24:34 -05:00
Thomas Grapperon
85050a28a9 Fix WithViewStore issues with Views using escaping closures (#1015)
* 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
2022-03-11 15:23:42 -05:00
bjford
dd084dc147 Fix UIKitCaseStudies' List example (#984) 2022-01-26 08:58:26 -05:00
rono23
5a62003f28 Remove unused codes (#972) 2022-01-16 17:19:40 -05:00
rono23
ce142f2e17 Fix filename (#970) 2022-01-15 10:56:50 -05:00
Stephen Celis
43b2ae66ea Scene delegate cleanup (#959)
* SwiftUI Case Studies: SceneDelegate -> App

* Generate plist files
2022-01-11 10:02:05 -05:00
Stephen Celis
fe97ad6027 Fix UIKit Case Study warning (#924)
* Fix UIKit Case Study warning

* wip

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-12-16 17:14:18 -05:00
Stephen Celis
87f388bedb Further Modernize Demos (#914)
* Modernize Demos

* wip
2021-12-09 22:41:58 -05:00
Stephen Celis
99426bb72e Fix Task.sleep deprecation warnings (#911) 2021-12-07 20:31:13 -05:00
stephencelis
8af720a021 Run swift-format 2021-12-07 14:14:59 +00:00
Wei Wang
63f2e77553 Add reset button to form binding case (#910) 2021-12-07 08:58:02 -05:00
Stephen Celis
a690937c25 Fix Alert Case Study (#860) 2021-10-18 10:21:23 -04:00
stephencelis
f92c2aec78 Run swift-format 2021-09-20 15:03:19 +00:00
Stephen Celis
0cd0c3ecce Update AlertState to use new APIs (#794)
* Update AlertState to use new APIs

* fix

* Feedback

* wip

* Fix

* wip

* wip

* wip

* wip
2021-09-20 10:42:17 -04:00
mbrandonw
bb5da6a0a4 Run swift-format 2021-09-20 14:12:18 +00:00