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

Add GroupsFeature library to example

parent 30dc5aae
No related branches found
No related tags found
2 merge requests!153Release 1.1.0,!149[Messenger example] create new group
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GroupsFeature"
BuildableName = "GroupsFeature"
BlueprintName = "GroupsFeature"
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 = "GroupsFeatureTests"
BuildableName = "GroupsFeatureTests"
BlueprintName = "GroupsFeatureTests"
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 = "GroupsFeature"
BuildableName = "GroupsFeature"
BlueprintName = "GroupsFeature"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -22,6 +22,7 @@ let package = Package(
.library(name: "ContactFeature", targets: ["ContactFeature"]),
.library(name: "ContactLookupFeature", targets: ["ContactLookupFeature"]),
.library(name: "ContactsFeature", targets: ["ContactsFeature"]),
.library(name: "GroupsFeature", targets: ["GroupsFeature"]),
.library(name: "HomeFeature", targets: ["HomeFeature"]),
.library(name: "MyContactFeature", targets: ["MyContactFeature"]),
.library(name: "RegisterFeature", targets: ["RegisterFeature"]),
......@@ -260,6 +261,26 @@ let package = Package(
],
swiftSettings: swiftSettings
),
.target(
name: "GroupsFeature",
dependencies: [
.target(name: "AppCore"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
.product(name: "ComposablePresentation", package: "swift-composable-presentation"),
.product(name: "XXClient", package: "elixxir-dapps-sdk-swift"),
.product(name: "XXMessengerClient", package: "elixxir-dapps-sdk-swift"),
.product(name: "XXModels", package: "client-ios-db"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "GroupsFeatureTests",
dependencies: [
.target(name: "GroupsFeature"),
.product(name: "CustomDump", package: "swift-custom-dump"),
],
swiftSettings: swiftSettings
),
.target(
name: "HomeFeature",
dependencies: [
......
......@@ -119,6 +119,16 @@
ReferencedContainer = "container:..">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GroupsFeatureTests"
BuildableName = "GroupsFeatureTests"
BlueprintName = "GroupsFeatureTests"
ReferencedContainer = "container:..">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
......
import ComposableArchitecture
public struct GroupsComponent: ReducerProtocol {
public struct State: Equatable {
public init() {}
}
public enum Action: Equatable {
case start
}
public var body: some ReducerProtocol<State, Action> {
Reduce { state, action in
switch action {
case .start:
return .none
}
}
}
}
import ComposableArchitecture
import SwiftUI
public struct GroupsView: View {
public typealias Component = GroupsComponent
public init(store: StoreOf<Component>) {
self.store = store
}
let store: StoreOf<Component>
struct ViewState: Equatable {
init(state: Component.State) {}
}
public var body: some View {
WithViewStore(store, observe: ViewState.init) { viewStore in
Form {
}
.navigationTitle("Groups")
.task { viewStore.send(.start) }
}
}
}
#if DEBUG
public struct GroupsView_Previews: PreviewProvider {
public static var previews: some View {
NavigationView {
GroupsView(store: Store(
initialState: GroupsComponent.State(),
reducer: EmptyReducer()
))
}
}
}
#endif
import ComposableArchitecture
import XCTest
@testable import GroupsFeature
final class GroupsComponentTests: XCTestCase {
func testStart() {
let store = TestStore(
initialState: GroupsComponent.State(),
reducer: GroupsComponent()
)
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