Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xx messenger iOS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
xx messenger iOS
Merge requests
!1
Project 'elixxir/client-ios' was moved to 'mobile/ios/client-ios'. Please update any links and bookmarks that may still have the old path.
Account recovery/backup feature
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Account recovery/backup feature
account-recovery
into
development
Overview
0
Commits
56
Pipelines
0
Changes
31
Merged
Account recovery/backup feature
Bruno Muniz
requested to merge
account-recovery
into
development
Feb 22, 2022
Overview
0
Commits
56
Pipelines
0
Changes
31
0
0
Merge request reports
Viewing commit
5b6e5b82
Prev
Next
Show latest version
31 files
+
1011
−
210
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
31
5b6e5b82
WIP: settings account backup UI
· 5b6e5b82
Bruno Muniz
authored
Feb 24, 2022
Sources/Models/Backup.swift
0 → 100644
+
75
−
0
View file @ 5b6e5b82
Edit in single-file editor
Open in Web IDE
import
Shared
import
Foundation
public
struct
BackupSettings
{
public
var
providers
:
[
BackupProvider
]
public
var
connections
:
[
BackupConnection
]
public
init
(
providers
:
[
BackupProvider
],
connections
:
[
BackupConnection
]
)
{
self
.
providers
=
providers
self
.
connections
=
connections
}
}
public
struct
BackupConnection
{
public
var
isEnabled
:
Bool
public
var
lastBackup
:
Backup
?
public
var
wifiOnlyBackup
:
Bool
public
var
automaticBackups
:
Bool
public
var
provider
:
BackupProvider
public
init
(
isEnabled
:
Bool
,
lastBackup
:
Backup
?
=
nil
,
wifiOnlyBackup
:
Bool
,
automaticBackups
:
Bool
,
provider
:
BackupProvider
)
{
self
.
isEnabled
=
isEnabled
self
.
lastBackup
=
lastBackup
self
.
wifiOnlyBackup
=
wifiOnlyBackup
self
.
automaticBackups
=
automaticBackups
self
.
provider
=
provider
}
}
public
struct
Backup
{
public
var
date
:
Date
public
var
size
:
Float
public
init
(
date
:
Date
,
size
:
Float
)
{
self
.
date
=
date
self
.
size
=
size
}
}
public
enum
BackupProvider
{
case
googleDrive
case
iCloud
case
dropbox
public
var
name
:
String
{
switch
self
{
case
.
iCloud
:
return
Localized
.
Backup
.
iCloud
case
.
dropbox
:
return
Localized
.
Backup
.
dropbox
case
.
googleDrive
:
return
Localized
.
Backup
.
googleDrive
}
}
public
var
asset
:
ImageAsset
.
Image
{
switch
self
{
case
.
iCloud
:
return
Asset
.
icloud
.
image
case
.
dropbox
:
return
Asset
.
dropbox
.
image
case
.
googleDrive
:
return
Asset
.
googleDrive
.
image
}
}
}
Loading