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
Commits
7ddd7cf6
Commit
7ddd7cf6
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Remove FactHelpers from AppCore library
parent
fb7ae222
No related branches found
No related tags found
2 merge requests
!102
Release 1.0.0
,
!68
Messenger example - send auth request
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/xx-messenger/Sources/AppCore/XXClientHelpers/FactHelpers.swift
+0
-55
0 additions, 55 deletions
...ssenger/Sources/AppCore/XXClientHelpers/FactHelpers.swift
with
0 additions
and
55 deletions
Examples/xx-messenger/Sources/AppCore/XXClientHelpers/FactHelpers.swift
deleted
100644 → 0
+
0
−
55
View file @
fb7ae222
import
XXClient
// TODO: Move to XXClient library
public
enum
FactType
:
Equatable
{
case
username
case
email
case
phone
case
other
(
Int
)
public
static
let
knownTypes
:
[
Self
]
=
[
.
username
,
.
email
,
.
phone
]
public
init
(
rawValue
:
Int
)
{
if
let
known
=
FactType
.
knownTypes
.
first
(
where
:
{
$0
.
rawValue
==
rawValue
})
{
self
=
known
}
else
{
self
=
.
other
(
rawValue
)
}
}
public
var
rawValue
:
Int
{
switch
self
{
case
.
username
:
return
0
case
.
email
:
return
1
case
.
phone
:
return
2
case
.
other
(
let
rawValue
):
return
rawValue
}
}
}
extension
Array
where
Element
==
Fact
{
public
func
get
(
_
type
:
FactType
)
->
Fact
?
{
first
(
where
:
{
$0
.
type
==
type
.
rawValue
})
}
public
mutating
func
set
(
_
type
:
FactType
,
_
value
:
String
?)
{
removeAll
(
where
:
{
$0
.
type
==
type
.
rawValue
})
if
let
value
=
value
{
append
(
Fact
(
fact
:
value
,
type
:
type
.
rawValue
))
sort
(
by
:
{
$0
.
type
<
$1
.
type
})
}
}
}
extension
Contact
{
public
func
getFact
(
_
type
:
FactType
)
throws
->
Fact
?
{
try
getFacts
()
.
get
(
type
)
}
public
mutating
func
setFact
(
_
type
:
FactType
,
_
value
:
String
?)
throws
{
var
facts
=
try
getFacts
()
facts
.
set
(
type
,
value
)
try
setFacts
(
facts
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment