This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from kinecosystem/restoring-restore-and-backup
Restoring restore and backup
- Loading branch information
Showing
66 changed files
with
3,347 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+5.58 KB
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Checkmark.imageset/Checkmark.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Checkmark.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Checkmark.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Eye.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Eye.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+3.9 KB
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Eye.imageset/Eye.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/QRCode.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "QRCode.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+4.74 KB
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/QRCode.imageset/QRCode.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Safe.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Safe.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+5.84 KB
KinBase/KinBase/Src/KinBackupRestoreModule/Assets.xcassets/Safe.imageset/Safe.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions
13
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/Bundle+BackupRestore.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Bundle+BackupRestore.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 04/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Bundle { | ||
static let backupRestore = Bundle(for: KinBackupRestoreManager.self) | ||
} |
16 changes: 16 additions & 0 deletions
16
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/CGGeometry+Appearance.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// CGGeometry+Appearance.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 14/04/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension CGFloat { | ||
static let cornerRadius: CGFloat = 4 | ||
static let borderWidth: CGFloat = UIScreen.main.scale >= 2 ? 0.5 : 1 | ||
|
||
static let minTapSurface: CGFloat = 44 | ||
} |
25 changes: 25 additions & 0 deletions
25
.../KinBase/Src/KinBackupRestoreModule/Extensions/NSAttributedString+AttributedStrings.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// NSAttributedString+AttributedStrings.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 14/04/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension NSAttributedString { | ||
convenience init(attributedStrings: [NSAttributedString], separator: String = "\n") { | ||
let attributedString = NSMutableAttributedString() | ||
|
||
for i in 0..<attributedStrings.count { | ||
attributedString.append(attributedStrings[i]) | ||
|
||
if i < attributedStrings.count - 1 { | ||
attributedString.append(NSAttributedString(string: separator)) | ||
} | ||
} | ||
|
||
self.init(attributedString: attributedString) | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/Notification+Convenience.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Notification+Convenience.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 21/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension Notification { | ||
var endFrame: CGRect { | ||
if let value = userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect { | ||
return value | ||
} | ||
else { | ||
return .null | ||
} | ||
} | ||
|
||
var duration: TimeInterval { | ||
if let value = userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval { | ||
return value | ||
} | ||
else { | ||
return 0.25 | ||
} | ||
} | ||
|
||
var animationOptions: UIView.AnimationOptions { | ||
if let value = userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber { | ||
return UIView.AnimationOptions(rawValue: UInt(value.uintValue << 16)) | ||
} | ||
else { | ||
return [] | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/String+Localization.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// String+Localization.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 05/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension String { | ||
func localized(_ args: CVarArg...) -> String { | ||
return String(format: NSLocalizedString(self, tableName: nil, bundle: .backupRestore, value: "", comment: ""), arguments: args) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/UIColor+Appearance.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// UIColor+Appearance.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 05/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIColor { | ||
static let kinPrimary = UIColor(red: 111/255, green: 65/255, blue: 232/255, alpha: 1) | ||
static let kinWarning = UIColor(red: 219/255, green: 73/255, blue: 123/255, alpha: 1) | ||
|
||
static let kinLightGray = UIColor(white: 231/255, alpha: 1) | ||
static let kinGray = UIColor(white: 166/255, alpha: 1) | ||
static let kinDarkGray = UIColor(white: 31/255, alpha: 1) | ||
} |
27 changes: 27 additions & 0 deletions
27
KinBase/KinBase/Src/KinBackupRestoreModule/Extensions/UIFont+PreferredFont.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// UIFont+PreferredFont.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 17/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIFont { | ||
class func preferredFont(forTextStyle style: TextStyle, symbolicTraits: [UIFontDescriptor.SymbolicTraits]) -> UIFont { | ||
let font = UIFont.preferredFont(forTextStyle: style) | ||
var traits = font.fontDescriptor.symbolicTraits | ||
|
||
for symbolicTrait in symbolicTraits { | ||
traits.insert(symbolicTrait) | ||
} | ||
|
||
if let fontDescriptor = font.fontDescriptor.withSymbolicTraits(traits) { | ||
return UIFont(descriptor: fontDescriptor, size: 0) | ||
} | ||
else { | ||
return font | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
KinBase/KinBase/Src/KinBackupRestoreModule/KinBackupRestoreBI.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// KinBackupRestoreBI.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 06/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
final class KinBackupRestoreBI { | ||
static let shared = KinBackupRestoreBI() | ||
weak var delegate: KinBackupRestoreBIDelegate? | ||
} | ||
|
||
public protocol KinBackupRestoreBIDelegate: NSObjectProtocol { | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
KinBase/KinBase/Src/KinBackupRestoreModule/KinBackupRestoreError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// KinBackupRestoreError.swift | ||
// KinBackupRestoreModule | ||
// | ||
// Created by Corey Werner on 24/02/2019. | ||
// Copyright © 2019 Kin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum KinBackupRestoreError: Error { | ||
case cantOpenImagePicker | ||
case internalInconsistency | ||
} | ||
|
||
extension KinBackupRestoreError: LocalizedError { | ||
public var errorDescription: String? { | ||
switch self { | ||
case .cantOpenImagePicker: | ||
return "Can't open the image picker." | ||
case .internalInconsistency: | ||
return "Internal inconsistency." | ||
} | ||
} | ||
} |
Oops, something went wrong.