Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Merge requests
!149
[Messenger example] create new group
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[Messenger example] create new group
feature/messenger-example-groups
into
development
Overview
0
Commits
13
Pipelines
0
Changes
4
Merged
Dariusz Rybicki
requested to merge
feature/messenger-example-groups
into
development
2 years ago
Overview
0
Commits
13
Pipelines
0
Changes
4
Expand
xx-messenger example
Add groups list screen
Add new group screen
Implement creating new group
Edited
2 years ago
by
Dariusz Rybicki
0
0
Merge request reports
Viewing commit
fcc9c039
Prev
Next
Show latest version
4 files
+
71
−
1
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
fcc9c039
Present new group from groups
· fcc9c039
Dariusz Rybicki
authored
2 years ago
Examples/xx-messenger/Sources/GroupsFeature/GroupsComponent.swift
+
26
−
1
Options
import
AppCore
import
AppCore
import
ComposableArchitecture
import
ComposableArchitecture
import
ComposablePresentation
import
Foundation
import
Foundation
import
NewGroupFeature
import
XXModels
import
XXModels
public
struct
GroupsComponent
:
ReducerProtocol
{
public
struct
GroupsComponent
:
ReducerProtocol
{
public
struct
State
:
Equatable
{
public
struct
State
:
Equatable
{
public
init
(
public
init
(
groups
:
IdentifiedArrayOf
<
Group
>
=
[]
groups
:
IdentifiedArrayOf
<
Group
>
=
[],
newGroup
:
NewGroupComponent
.
State
?
=
nil
)
{
)
{
self
.
groups
=
groups
self
.
groups
=
groups
self
.
newGroup
=
newGroup
}
}
public
var
groups
:
IdentifiedArrayOf
<
XXModels
.
Group
>
=
[]
public
var
groups
:
IdentifiedArrayOf
<
XXModels
.
Group
>
=
[]
public
var
newGroup
:
NewGroupComponent
.
State
?
}
}
public
enum
Action
:
Equatable
{
public
enum
Action
:
Equatable
{
case
start
case
start
case
didFetchGroups
([
XXModels
.
Group
])
case
didFetchGroups
([
XXModels
.
Group
])
case
didSelectGroup
(
XXModels
.
Group
)
case
didSelectGroup
(
XXModels
.
Group
)
case
newGroupButtonTapped
case
newGroupDismissed
case
newGroup
(
NewGroupComponent
.
Action
)
}
}
public
init
()
{}
public
init
()
{}
@@ -45,7 +53,24 @@ public struct GroupsComponent: ReducerProtocol {
@@ -45,7 +53,24 @@ public struct GroupsComponent: ReducerProtocol {
case
.
didSelectGroup
(
_
):
case
.
didSelectGroup
(
_
):
return
.
none
return
.
none
case
.
newGroupButtonTapped
:
state
.
newGroup
=
NewGroupComponent
.
State
()
return
.
none
case
.
newGroupDismissed
:
state
.
newGroup
=
nil
return
.
none
case
.
newGroup
(
_
):
return
.
none
}
}
}
}
.
presenting
(
state
:
.
keyPath
(\
.
newGroup
),
id
:
.
notNil
(),
action
:
/
Action
.
newGroup
,
presented
:
{
NewGroupComponent
()
}
)
}
}
}
}
Loading