Skip to content
Snippets Groups Projects
Commit a047d57f authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add MyContactFeature library to example app

parent f87c132f
No related branches found
No related tags found
1 merge request!14[Example App] Make identity & contact
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyContactFeature"
BuildableName = "MyContactFeature"
BlueprintName = "MyContactFeature"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyContactFeatureTests"
BuildableName = "MyContactFeatureTests"
BlueprintName = "MyContactFeatureTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyContactFeature"
BuildableName = "MyContactFeature"
BlueprintName = "MyContactFeature"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -48,6 +48,20 @@
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyContactFeature"
BuildableName = "MyContactFeature"
BlueprintName = "MyContactFeature"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
......@@ -115,6 +129,16 @@
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyContactFeatureTests"
BuildableName = "MyContactFeatureTests"
BlueprintName = "MyContactFeatureTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
......
......@@ -32,6 +32,10 @@ let package = Package(
name: "LandingFeature",
targets: ["LandingFeature"]
),
.library(
name: "MyContactFeature",
targets: ["MyContactFeature"]
),
.library(
name: "MyIdentityFeature",
targets: ["MyIdentityFeature"]
......@@ -137,6 +141,23 @@ let package = Package(
],
swiftSettings: swiftSettings
),
.target(
name: "MyContactFeature",
dependencies: [
.product(
name: "ComposableArchitecture",
package: "swift-composable-architecture"
),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "MyContactFeatureTests",
dependencies: [
.target(name: "MyContactFeature"),
],
swiftSettings: swiftSettings
),
.target(
name: "MyIdentityFeature",
dependencies: [
......
import ComposableArchitecture
public struct MyContactState: Equatable {
public init(
id: UUID
) {
self.id = id
}
public var id: UUID
}
public enum MyContactAction: Equatable {
case viewDidLoad
}
public struct MyContactEnvironment {
public init() {}
}
public let myContactReducer = Reducer<MyContactState, MyContactAction, MyContactEnvironment>
{ state, action, env in
switch action {
case .viewDidLoad:
return .none
}
}
#if DEBUG
extension MyContactEnvironment {
public static let failing = MyContactEnvironment()
}
#endif
import ComposableArchitecture
import SwiftUI
public struct MyContactView: View {
public init(store: Store<MyContactState, MyContactAction>) {
self.store = store
}
let store: Store<MyContactState, MyContactAction>
struct ViewState: Equatable {
init(state: MyContactState) {}
}
public var body: some View {
WithViewStore(store.scope(state: ViewState.init)) { viewStore in
Text("MyContactView")
.navigationTitle("My contact")
.task {
viewStore.send(.viewDidLoad)
}
}
}
}
#if DEBUG
public struct MyContactView_Previews: PreviewProvider {
public static var previews: some View {
NavigationView {
MyContactView(store: .init(
initialState: .init(id: UUID()),
reducer: .empty,
environment: ()
))
}
.navigationViewStyle(.stack)
}
}
#endif
import XCTest
@testable import MyContactFeature
final class MyContactFeatureTests: XCTestCase {
func testExample() {
XCTAssert(true)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment