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
!18
Update Bindings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update Bindings
feature/update-bindings
into
development
Overview
3
Commits
164
Pipelines
0
Changes
1
Merged
Dariusz Rybicki
requested to merge
feature/update-bindings
into
development
2 years ago
Overview
3
Commits
164
Pipelines
0
Changes
1
Expand
Update Bindings.xcframework (release
https://git.xx.network/elixxir/client/-/pipelines/125767
)
Update Bindings.xcframework (release
https://git.xx.network/elixxir/client/-/pipelines/132481
)
Update Bindings.xcframework (release
https://git.xx.network/elixxir/client/-/pipelines/133113
)
Update Bindings.xcframework (release
https://git.xx.network/elixxir/client/-/pipelines/133582
)
Update Bindings.xcframework (release
https://git.xx.network/elixxir/client/-/pipelines/133688
)
Use models instead of raw data whenever possible
User Discovery
Backup
File Transfers
Channels
Edited
2 years ago
by
Dariusz Rybicki
0
0
Merge request reports
Viewing commit
6a540463
Prev
Next
Show latest version
1 file
+
34
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
6a540463
Add SetFactsOnContact functor
· 6a540463
Dariusz Rybicki
authored
2 years ago
Sources/ElixxirDAppsSDK/
Legacy/ContactFactsSetter
.swift
→
Sources/ElixxirDAppsSDK/
SetFactsOnContact
.swift
+
34
−
0
Options
import
Bindings
import
XCTestDynamicOverlay
public
struct
ContactFactsSetter
{
public
var
set
:
(
Data
,
[
Fact
])
throws
->
Data
public
struct
SetFactsOnContact
{
public
var
run
:
(
Data
,
[
Fact
])
throws
->
Data
public
func
callAsFunction
(
contact
:
Data
,
facts
:
[
Fact
]
)
throws
->
Data
{
try
set
(
contact
,
facts
)
try
run
(
contact
,
facts
)
}
}
extension
ContactFactsSetter
{
public
static
let
live
=
ContactFactsSetter
{
contact
,
facts
in
let
encoder
=
JSONEncoder
()
let
factsData
=
try
encoder
.
encode
(
facts
)
extension
SetFactsOnContact
{
public
static
let
live
=
SetFactsOnContact
{
contact
,
facts
in
let
factsData
=
try
facts
.
encode
()
var
error
:
NSError
?
let
updatedContact
=
BindingsSetFactsOnContact
(
contact
,
factsData
,
&
error
)
if
let
error
=
error
{
@@ -27,11 +27,8 @@ extension ContactFactsSetter {
}
}
#if DEBUG
extension
ContactFactsSetter
{
public
static
let
failing
=
ContactFactsSetter
{
_
,
_
in
struct
NotImplemented
:
Error
{}
throw
NotImplemented
()
}
extension
SetFactsOnContact
{
public
static
let
unimplemented
=
SetFactsOnContact
(
run
:
XCTUnimplemented
(
"
\(
Self
.
self
)
"
)
)
}
#endif
Loading