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

Add ContactsFeature library

parent 490948a0
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!75Messenger example - contacts list
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ContactsFeature"
BuildableName = "ContactsFeature"
BlueprintName = "ContactsFeature"
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 = "ContactsFeatureTests"
BuildableName = "ContactsFeatureTests"
BlueprintName = "ContactsFeatureTests"
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 = "ContactsFeature"
BuildableName = "ContactsFeature"
BlueprintName = "ContactsFeature"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
...@@ -21,6 +21,7 @@ let package = Package( ...@@ -21,6 +21,7 @@ let package = Package(
.library(name: "AppCore", targets: ["AppCore"]), .library(name: "AppCore", targets: ["AppCore"]),
.library(name: "AppFeature", targets: ["AppFeature"]), .library(name: "AppFeature", targets: ["AppFeature"]),
.library(name: "ContactFeature", targets: ["ContactFeature"]), .library(name: "ContactFeature", targets: ["ContactFeature"]),
.library(name: "ContactsFeature", targets: ["ContactsFeature"]),
.library(name: "HomeFeature", targets: ["HomeFeature"]), .library(name: "HomeFeature", targets: ["HomeFeature"]),
.library(name: "RegisterFeature", targets: ["RegisterFeature"]), .library(name: "RegisterFeature", targets: ["RegisterFeature"]),
.library(name: "RestoreFeature", targets: ["RestoreFeature"]), .library(name: "RestoreFeature", targets: ["RestoreFeature"]),
...@@ -111,6 +112,23 @@ let package = Package( ...@@ -111,6 +112,23 @@ let package = Package(
], ],
swiftSettings: swiftSettings swiftSettings: swiftSettings
), ),
.target(
name: "ContactsFeature",
dependencies: [
.target(name: "AppCore"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
.product(name: "ComposablePresentation", package: "swift-composable-presentation"),
.product(name: "XXModels", package: "client-ios-db"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "ContactsFeatureTests",
dependencies: [
.target(name: "ContactsFeature"),
],
swiftSettings: swiftSettings
),
.target( .target(
name: "HomeFeature", name: "HomeFeature",
dependencies: [ dependencies: [
......
...@@ -59,6 +59,16 @@ ...@@ -59,6 +59,16 @@
ReferencedContainer = "container:.."> ReferencedContainer = "container:..">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ContactsFeatureTests"
BuildableName = "ContactsFeatureTests"
BlueprintName = "ContactsFeatureTests"
ReferencedContainer = "container:..">
</BuildableReference>
</TestableReference>
<TestableReference <TestableReference
skipped = "NO"> skipped = "NO">
<BuildableReference <BuildableReference
......
import ComposableArchitecture
import XCTestDynamicOverlay
public struct ContactsState: Equatable {
public init() {}
}
public enum ContactsAction: Equatable {
case start
}
public struct ContactsEnvironment {
public init() {}
}
#if DEBUG
extension ContactsEnvironment {
public static let unimplemented = ContactsEnvironment()
}
#endif
public let contactsReducer = Reducer<ContactsState, ContactsAction, ContactsEnvironment>
{ state, action, env in
switch action {
case .start:
return .none
}
}
import ComposableArchitecture
import SwiftUI
public struct ContactsView: View {
public init(store: Store<ContactsState, ContactsAction>) {
self.store = store
}
let store: Store<ContactsState, ContactsAction>
struct ViewState: Equatable {
init(state: ContactsState) {}
}
public var body: some View {
WithViewStore(store.scope(state: ViewState.init)) { viewStore in
Form {
}
.navigationTitle("Contacts")
.task { viewStore.send(.start) }
}
}
}
#if DEBUG
public struct ContactsView_Previews: PreviewProvider {
public static var previews: some View {
NavigationView {
ContactsView(store: Store(
initialState: ContactsState(),
reducer: .empty,
environment: ()
))
}
}
}
#endif
import ComposableArchitecture
import XCTest
@testable import ContactsFeature
final class ContactsFeatureTests: XCTestCase {
func testStart() {
let store = TestStore(
initialState: ContactsState(),
reducer: contactsReducer,
environment: .unimplemented
)
store.send(.start)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment