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
bcd5306e
Commit
bcd5306e
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add NetworkFollowerStopper
parent
be1b361d
No related branches found
No related tags found
1 merge request
!2
Bindings API wrapper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/NetworkFollower.swift
+5
-2
5 additions, 2 deletions
Sources/ElixxirDAppsSDK/NetworkFollower.swift
Sources/ElixxirDAppsSDK/NetworkFollowerStopper.swift
+24
-0
24 additions, 0 deletions
Sources/ElixxirDAppsSDK/NetworkFollowerStopper.swift
with
29 additions
and
2 deletions
Sources/ElixxirDAppsSDK/NetworkFollower.swift
+
5
−
2
View file @
bcd5306e
...
...
@@ -3,13 +3,15 @@ import Bindings
public
struct
NetworkFollower
{
public
var
status
:
NetworkFollowerStatusProvider
public
var
start
:
NetworkFollowerStarter
public
var
stop
:
NetworkFollowerStopper
}
extension
NetworkFollower
{
public
static
func
live
(
bindingsClient
:
BindingsClient
)
->
NetworkFollower
{
NetworkFollower
(
status
:
.
live
(
bindingsClient
:
bindingsClient
),
start
:
.
live
(
bindingsClient
:
bindingsClient
)
start
:
.
live
(
bindingsClient
:
bindingsClient
),
stop
:
.
live
(
bindingsClient
:
bindingsClient
)
)
}
}
...
...
@@ -18,7 +20,8 @@ extension NetworkFollower {
extension
NetworkFollower
{
public
static
let
failing
=
NetworkFollower
(
status
:
.
failing
,
start
:
.
failing
start
:
.
failing
,
stop
:
.
failing
)
}
#endif
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/NetworkFollowerStopper.swift
0 → 100644
+
24
−
0
View file @
bcd5306e
import
Bindings
public
struct
NetworkFollowerStopper
{
public
var
stop
:
()
throws
->
Void
public
func
callAsFunction
()
throws
{
try
stop
()
}
}
extension
NetworkFollowerStopper
{
public
static
func
live
(
bindingsClient
:
BindingsClient
)
->
NetworkFollowerStopper
{
NetworkFollowerStopper
(
stop
:
bindingsClient
.
stopNetworkFollower
)
}
}
#if DEBUG
extension
NetworkFollowerStopper
{
public
static
let
failing
=
NetworkFollowerStopper
{
struct
NotImplemented
:
Error
{}
throw
NotImplemented
()
}
}
#endif
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