Commit Graph

106 Commits

Author SHA1 Message Date
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
유재호
6915844f76 Add final keyword to every test class by default (#1267) 2022-08-15 14:37:30 -04: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
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
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
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
mbrandonw
9f1cfeeaf0 Run swift-format 2022-05-30 19:51:08 +00:00
Brandon Williams
ea010ff15a Fix for attribute cycle in tic-tac-toe. (#1114)
* Fix for attribute cytcle.

* wip

* wip
2022-05-30 12:44:28 -07: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
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
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
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
87f388bedb Further Modernize Demos (#914)
* Modernize Demos

* wip
2021-12-09 22:41:58 -05:00
Stephen Celis
edfe198d01 Fix typo in Tic-Tac-Toe demo (#905) 2021-12-01 10:12:39 -05:00
Ken Grigsby
c41f8c4a21 Remove duplicate debug (#888) 2021-11-11 15:19:16 -05:00
iampatbrown
b5719bf1ca Update example app entry points and some minor changes (#859)
* TicTacToe Readme updates

* Use new .catchToEffect(_ transform:) in example

* Added Todos Readme

* Added VoiceMemos Readme wip

* Updated VoiceMomos Readme

* Updated Todos Readme

* Added value to animation modifier

* Update VoiceMemos entry point

* Update Todos entry point

* Update Search entry point

* Update SpeechRecognition entry point

* Updated SpeechRecognition models

* Revert "Updated SpeechRecognition models"

This reverts commit dc77e7a638.
2021-10-18 09:24:02 -04:00
Stephen Celis
575d7c0d59 Use Custom Dump (#736)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* Model Tic-Tac-Toe board using proper type

* wip

* wip

* wip

* wip

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-08-22 22:45:27 -04:00
Stephen Celis
40a6c2cd7d Model Tic-Tac-Toe board using proper type (#722)
* Model Tic-Tac-Toe board using proper type

* Update GameCore.swift

* wip

* wip
2021-08-19 10:59:36 -04:00
Brandon Williams
a38e04da7d Modernize some things (#713)
* Modernize some things.

* clean up

* wip

* wip

* clean up

* wip

* wip
2021-08-12 18:13:40 -04:00
Stephen Celis
68a6883045 Use modify helper in Tic-Tac-Toe integration test (#687)
* Use `modify` helper

* Clean up breakpoint warnings
2021-07-29 16:40:59 -04:00
Stephen Celis
7a19bd63f5 Clean up for Tic-Tac-Toe updates (#685) 2021-07-29 11:21:50 -04:00
stephencelis
55cf912712 Run swift-format 2021-07-29 13:24:54 +00:00
Stephen Celis
026482d270 tic-tac-toe package (#684)
* tic-tac-toe package

* Update Package.swift

* Tests

* wip

* wip

* wip

* Update Package.swift
2021-07-29 09:18:49 -04:00
Stephen Celis
cd76e31ef6 Update demos to use failing environments (#650) 2021-07-12 17:36:40 -04:00
Brandon Williams
14c6b5b218 Extract number fact dependency to a FactClient. (#600)
* Extract number fact dependency to a FactClient.

* wip
2021-06-21 10:36:51 -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
2bd9b7568e Run swift-format 2021-05-04 14:30:23 +00:00
Brandon Williams
6f1bc259e4 Modernize examples (#525)
* Refactor some of the example code.

* wip

* wip

* wip

* lots more updates

* fixes

* another fix

* todo simplification

* fix compiler issue in 11.7

* Update Examples/Todos/Todos/Todos.swift

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

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2021-05-04 09:17:21 -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
Hung Truong
1a7b69cdb5 Fix background colors in UIKit demos to work in light and dark mode (#482) 2021-04-07 17:51:30 -07:00
stephencelis
fcb84e1d1a Run swift-format 2021-03-22 17:40:03 +00: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
stephencelis
f967d1a9fb Run swift-format 2021-03-19 17:04:08 +00:00
Stephen Celis
6fd917bf19 Stop using Form in Tic-Tac-Toe example (#448) 2021-03-19 11:54:51 -04: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
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
Stephen Celis
166acfa4fc Use serial queue for Tic Tac Toe authorization (#320) 2020-11-09 14:22:51 -05:00
Stephen Celis
fe06d95cff Fix Tic Tac Toe Optional Bug (#291) 2020-09-16 12:44:08 -04:00
Stephen Celis
5171335620 Localizable Alerts and Action Sheets (#275)
* Localizable Alerts and Action Sheets

Fixes #237.

* Tests/fixes

* Update LocalizedStringKey.swift

* Fix
2020-08-31 16:31:34 -04:00
Morten Heiberg
339feec7db Fix TicTacToe auth error localization (#234) 2020-07-23 19:31:00 -04:00
Alejandro Martínez
f40942fa08 Added file and line to optional assert (#218)
* Added file and line to optional assert

* Apply suggestions from code review

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

* Deprecate old optional property and migrated TicTacToe example

* Migrated other examples to optional() and added file/line to forEach

* Update Deprecations.swift

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2020-07-08 17:18:48 -04:00
mbrandonw
b8c67d5d4f Run swift-format 2020-06-30 14:49:39 +00:00
Brandon Williams
a905fbf5ec Generic alerts and action sheets (#201)
* alerts

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* format

* clean up

* clean up

* docs

* wip

* tests

* API tweaks

* Fix

* More API changes

* More API changes

* More

* Fix

* Fix docs

* Generic alerts optionality (#202)

* Use Optional to model generic alerts

* Xcode 12

* Refinement

* update docs

* Fix

* Fix

* doc fixes

* rename

* fixes

* fixes

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2020-06-30 09:48:36 -05:00
Stephen Celis
3d89482da6 Add assertion to Reducer.optional (#157)
* Add assertion to Reducer.optional

* Another bug

* Another potential bug

* best practice?

* WIP

* Clean up language and add more language to index-based forEach

* Re-wrap

* Update Sources/ComposableArchitecture/Reducer.swift

Co-authored-by: Brandon Williams <mbw234@gmail.com>

* Update Sources/ComposableArchitecture/Reducer.swift

Co-authored-by: Brandon Williams <mbw234@gmail.com>

* wording

Co-authored-by: Brandon Williams <mbw234@gmail.com>
2020-06-04 13:57:25 -04:00
Stephen Celis
05ed4deabc Make demos render better on iPad (#122) 2020-05-20 15:32:56 -04:00
Brandon Williams
812a7fa83f Remove some old tests and guard debug code in #if DEBUG. (#104)
* Remove some old tests and guard debug code in #if DEBUG.

* remove background color

* fix test targets

* clean up more tests
2020-05-15 09:32:05 -07:00
Stephen Celis
6f9dee713f Demos Xcode 11.3.1 support (#52)
* Demos Xcode 11.3.1 support

* Fix

* wip

* Skip test
2020-05-11 18:37:25 -04:00