Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial fixes and updates #3003

Merged
merged 9 commits into from
Apr 19, 2024
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp
Copy link
Contributor Author

@dafurman dafurman Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just mimicking what's going on in the Navigation part, where the main app target is imported


@MainActor
final class CounterFeatureTests: XCTestCase {
func testCounter() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testCounter() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testCounter() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testCounter() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testCounter() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testTimer() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import ComposableArchitecture
import XCTest

@testable import CounterApp

@MainActor
final class CounterFeatureTests: XCTestCase {
func testNumberFact() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
Now we see the problem with using uncontrolled dependencies in our feature code. It makes our
code hard to test, and can make tests take a long time to run or become flakey.

For these reasons, and more, it is highly encouraged for you to control you dependency on
For these reasons, and more, it is highly encouraged for you to control your dependency on
external systems (see <doc:DependencyManagement> for more information). The Composable
Architecture comes with a complete set of tools for controlling and propagating dependencies
throughout an application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
and perform any state mutations necessary based on the action passed in.

We still want to do that for the core logic of the app feature, but we also want compose in
the `CounterFeature` reducer so that it's logic can execute on the `tab1` and `tab2` state
the `CounterFeature` reducer so that its logic can execute on the `tab1` and `tab2` state
without the `AppFeature` having to recreate it.

@Code(name: "AppFeature.swift", file: 01-04-02-code-0003.swift)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
}

@Step {
Make use of the new `deleteConfirmation` static alert function in the `CounterFeature`
Make use of the new `deleteConfirmation` static alert function in the `ContactsFeature`
reducer, rather than building `AlertState` from scratch.

@Code(name: "ContactsFeature.swift", file: 02-03-03-code-0007.swift, previousFile: 02-03-03-code-0007-previous.swift)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ struct ContactDetailView: View {
var body: some View {
Form {
}
.navigationBarTitle(Text(store.contact.name))
.navigationTitle(Text(store.contact.name))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from the deprecated navigationBarTitle to the newer modifier.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct ContactDetailView: View {
var body: some View {
Form {
}
.navigationBarTitle(Text(store.contact.name))
.navigationTitle(Text(store.contact.name))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct ContactDetailView: View {
var body: some View {
Form {
}
.navigationBarTitle(Text(store.contact.name))
.navigationTitle(Text(store.contact.name))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct ContactDetailView: View {
store.send(.deleteButtonTapped)
}
}
.navigationBarTitle(Text(store.contact.name))
.navigationTitle(Text(store.contact.name))
.alert($store.scope(state: \.alert, action: \.alert))
}
}
Expand Down