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
4fef1f7f
Commit
4fef1f7f
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Change type of Fact.type property to FactType
parent
0d5af7e3
No related branches found
No related tags found
2 merge requests
!102
Release 1.0.0
,
!71
Fact improvements & helpers
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/XXClient/Models/Fact.swift
+5
-5
5 additions, 5 deletions
Sources/XXClient/Models/Fact.swift
Tests/XXClientTests/Models/FactTests.swift
+2
-2
2 additions, 2 deletions
Tests/XXClientTests/Models/FactTests.swift
with
7 additions
and
7 deletions
Sources/XXClient/Models/Fact.swift
+
5
−
5
View file @
4fef1f7f
...
@@ -3,14 +3,14 @@ import Foundation
...
@@ -3,14 +3,14 @@ import Foundation
public
struct
Fact
:
Equatable
{
public
struct
Fact
:
Equatable
{
public
init
(
public
init
(
fact
:
String
,
fact
:
String
,
type
:
Int
type
:
FactType
)
{
)
{
self
.
fact
=
fact
self
.
fact
=
fact
self
.
type
=
type
self
.
type
=
type
}
}
public
var
fact
:
String
public
var
fact
:
String
public
var
type
:
Int
public
var
type
:
FactType
}
}
extension
Fact
:
Codable
{
extension
Fact
:
Codable
{
...
@@ -46,13 +46,13 @@ extension Array where Element == Fact {
...
@@ -46,13 +46,13 @@ extension Array where Element == Fact {
extension
Array
where
Element
==
Fact
{
extension
Array
where
Element
==
Fact
{
public
func
get
(
_
type
:
FactType
)
->
Fact
?
{
public
func
get
(
_
type
:
FactType
)
->
Fact
?
{
first
(
where
:
{
$0
.
type
==
type
.
rawValue
})
first
(
where
:
{
$0
.
type
==
type
})
}
}
public
mutating
func
set
(
_
type
:
FactType
,
_
value
:
String
?)
{
public
mutating
func
set
(
_
type
:
FactType
,
_
value
:
String
?)
{
removeAll
(
where
:
{
$0
.
type
==
type
.
rawValue
})
removeAll
(
where
:
{
$0
.
type
==
type
})
if
let
value
=
value
{
if
let
value
=
value
{
append
(
Fact
(
fact
:
value
,
type
:
type
.
rawValue
))
append
(
Fact
(
fact
:
value
,
type
:
type
))
sort
(
by
:
{
$0
.
type
<
$1
.
type
})
sort
(
by
:
{
$0
.
type
<
$1
.
type
})
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Tests/XXClientTests/Models/FactTests.swift
+
2
−
2
View file @
4fef1f7f
...
@@ -5,7 +5,7 @@ import XCTest
...
@@ -5,7 +5,7 @@ import XCTest
final
class
FactTests
:
XCTestCase
{
final
class
FactTests
:
XCTestCase
{
func
testCoding
()
throws
{
func
testCoding
()
throws
{
let
factValue
=
"Zezima"
let
factValue
=
"Zezima"
let
factType
:
Int
=
0
let
factType
:
Int
=
123
let
jsonString
=
"""
let
jsonString
=
"""
{
{
"
Fact
": "
\(
factValue
)
",
"
Fact
": "
\(
factValue
)
",
...
@@ -17,7 +17,7 @@ final class FactTests: XCTestCase {
...
@@ -17,7 +17,7 @@ final class FactTests: XCTestCase {
XCTAssertNoDifference
(
model
,
Fact
(
XCTAssertNoDifference
(
model
,
Fact
(
fact
:
factValue
,
fact
:
factValue
,
type
:
factType
type
:
123
))
))
let
encodedModel
=
try
model
.
encode
()
let
encodedModel
=
try
model
.
encode
()
...
...
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